🌍 Public
Viewing a saved revision (read-only)
175dda02b6e34793a9d0fbaf673be06c
Making a Bar Chart
This bar chart displays the top 10 most populous countries in 2018, using population estimates from the United Nations World Population Prospects 2017. It renders horizontal bars with D3 v5’s `scaleBand` for the y-axis and `scaleLinear` for the x-axis, using `axisLeft` and `axisBottom` for ticks. The data is loaded from a CSV via `d3.csv`, with population values multiplied by 1000. The SVG output uses `g.selectAll('rect')` to draw each bar, styled with a steelblue fill.
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.