If you look closely, you'll see that the bars for the first and the fourth items are drawn at the same positions and overlap.
The fundamental problem is that the code is using the data itself (which is duplicated) to identify individual elements. If you want to have different elements with the same data values, you'll need to give them unique identifiers so that the code is able to distinguish between them. The scales in the code are set up such that the same input value will map to the same output value, i.e. if you have the same name, the bars will be drawn at the same position.
One way of solving this problem would be to use a unique ID as input to the scale functions and then a formatter to make the labels from this ID.
- d3 axis not showing tick label if two ticks have the same value
- In d3.js ticks are not showing in the x axis
- How do I assign ticks to be equal to a different key value from the same object from the one on which the axis is based on in D3.js?
- D3 Line chart - display value label on Y axis tick and a not scale
- d3 axis is not showing any values if there is only 1 value in the domain
- How to display the value for the final tick on axis in D3?
- Data points and ticks in the scaleBand axis are not aligned
- How do I reduce two arrays to a single value that is present at the same index?
- Limit number of Y axis ticks by keeping a top tick above the bar in d3
- How to create left axis with variable tick interval in tick values and has same distance between tick value
- d3js:The xaxis time is not showing the complete date value
- The axis label at x=0 does not show up
- D3.js: Text is not showing inside a circle(They are on the same level of an element-group). How do I bring the text to the front?
- Abnormal width when I have two graph D3.js on the same page
- Connect childs of a D3.js tree diagram if they have the same value
- d3 chart is showing some decimal value in the X axis tick, instead of showing the date and time
- CSV File opened using JS not showing the updated version of the file when replaced by another one with the same name. d3.csv
- d3.js - adding One additional tick for the Y axis does not work
- x axis label not showing up in d3 scatter plot
- D3.js - Adding a tick value on the x axis (date format)
- d3 time format x axis showing same value
- D3js Ordinal Axis does not show all the ticks
- Circle on chart not following the ticks in axis
- How to make axis label of stacked bar chart in the middle of ticks chart in D3?
- C3 bargraph going upper-side if we give y axis max value and the data array are same
- x-axis tick is not incremented correctly and it is set to the max value of y
- Line not visible in line chart when having same value in the domain() - using D3
- d3.js: Align text labels between ticks on the axis
- How can I get the D3.js axis ticks and positions as an array?
- D3js v4: scaleOrdinal does not have the rangePoints()
More Query from same tag
- Create custom a d3 generator
- Cannot align ticks to bars in bar chart
- How do i stop the label interaction in my force layout D3?
- disable y-axis max and min values on nvd3 boxplot
- d3 graph: What code to write in dblclick handler to change a node text
- Adding multiple objects to svg and adding drag behaviour issue
- d3js,when mouse drag the blank area,the force graph keeps jumping
- d3.js - shifting y-axis on stacked graph chart
- D3 chart curve has wrong data in tick label
- d3js timeline -- on scrub day generate a clean granular view for date and time
- D3 Collapsible tree: Scrollable container for tree
- how to make real time multi line chart using d3 where data is from api in json format
- How to work with CSV data in D3
- d3 pie labels aren't in right place, centroids are way off for some reason
- Get arrowheads to point at outer edge of node in D3
- How do i give ellipsis in axis labels in d3 v4?
- D3 date parsing: Uncaught TypeError
- Scrolling vertically a d3 chart in scroll container
- how to make a radial line segment using D3.js
- using d3.js to store a svg line chart as an image on the client side
- How to call a specific node for a class in D3 force layout?
- nice() method for ticks in nvd3
- Flatten D3.js Nested Data or Map it to new Dataset
- Making An HTML element inside a D3-Tip Trigger Click Event
- D3 Sankey Diagram. changing the link color and moving the node
- How to update d3 table?
- explanation of d3.js transform and translate functions
- Apply updated data to line/path?
- d3.js tree layout compatibility with IE