Making a Bar Chart
✓ Published1🌍 Public
This example shows a bar chart of the top 10 most populous countries, using 2018 population estimates from the United Nations World Population Prospects. The bars are rendered as SVG rectangles, with a linear scale mapping population values to widths and a band scale positioning each country’s bar vertically. The code uses React to create a placeholder circle, but the visible chart is built by commented-out D3 code that would call `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to load and plot the data.
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