Making a Bar Chart
✓ Published0🌍 Public
This example uses D3 v5 to render a horizontal bar chart of the top 10 most populous countries, with population values from the 2017 United Nations World Population Prospects (2018 estimates). It employs `scaleLinear` and `scaleBand` for positioning and sizing, and customizes the axes via `axisBottom` with a tick formatter that converts large numbers to billions. The chart’s bars are drawn as SVG rectangles, with axis labels and a title added as text elements.
AI-generated descriptionThis bar chart shows population of the top 10 most populous countries. The data comes from the year 2018 estimate in United Nations: World Population Prospects 2017. It also demonstrates customization of D3 axes.
MIT Licensed