Making a Bar Chart
✓ Published1🌍 Public
This example displays the populations of the world’s ten most populous countries as a horizontal bar chart, using 2018 estimates from the United Nations World Population Prospects. The chart is rendered as SVG, with bars encoded by a linear population scale and countries by a band scale. Built with D3 v6, the code uses `csv` to load data, `scaleLinear` and `scaleBand` for scaling, and `axisLeft` and `axisBottom` for axes. Population values are multiplied by 1,000 to reflect actual figures, and bars are styled with a steelblue fill.
AI-generated descriptionThis bar chart shows the population of the top 10 most populous countries. The data comes from the year 2018 estimate in United Nations: World Population Prospects 2017.
MIT Licensed