Making a Bar Chart
✓ Published0🌍 Public
This example shows a horizontal bar chart of the populations of the ten most populous countries, based on 2020 estimates from the United Nations World Population Prospects. The chart uses D3 v5 with SVG rendering, and the code imports `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` from D3. Population values are loaded from a local CSV file, converted from thousands to absolute numbers, and mapped to bar widths via the linear scale, while country names position each bar along the band scale.
AI-generated descriptionThis bar chart shows population of the top 10 most populouse countreis. The data comes from the year 2020 estimate in United nations: World Population Prospects 2019
MIT Licensed