Making a Bar Chart
✓ Published0🌍 Public
This example visualizes the top 10 most populous countries in 2018, with a horizontal bar chart ranking nations from China to Mexico based on population estimates from the United Nations World Population Prospects 2017. The D3 v5 code uses `csv()` to load data, `scaleLinear` for the x-axis, `scaleBand` for the y-axis, and `axisLeft`/`axisBottom` to render axes as SVG elements. Population values are multiplied by 1000 for accurate representation, with steelblue rectangles drawn using the `selectAll` and `append` methods.
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.
MIT Licensed