Making a Bar Chart
✓ Published0🌍 Public
This example displays the population of the ten most populous countries, based on 2018 United Nations estimates from World Population Prospects 2017, as horizontal bars. The chart uses D3 v5 with `d3.scaleLinear` for the x-axis, `d3.scaleBand` for the y-axis, and `d3.axisLeft` and `d3.axisBottom` for tick rendering. Data is loaded from a CSV via `d3.csv`, and each bar’s width is scaled proportionally to population values, multiplied by 1000. The SVG output is styled with steelblue rectangles.
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