Making a Bar Chart
✓ Published0🌍 Public
This example shows a bar chart of the ten most populous countries using 2018 estimates from the United Nations World Population Prospects. A linear scale positions the bars horizontally, while a band scale orders the country names vertically, with D3 axes customized to format population values and draw gridlines. The code uses `d3.csv`, `scaleLinear`, `scaleBand`, `axisBottom`, and `axisLeft` from D3 v5, rendering the chart as SVG 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