Making a Bar Chart
✓ Published1🌍 Public
This example shows a horizontal bar chart of the population for the ten most populous countries, using 2018 estimates from the World Population Prospects 2017. The chart is rendered as an SVG, with bars ordered by country name and scaled linearly by population. The code uses D3 v5 modules including `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to load data, compute scales, and draw axes. Population values are multiplied by 1000 to reflect actual counts, and bars are 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 World Population Prospects 2017.
MIT Licensed