Making a Bar Chart
✓ Published0🌍 Public
This example presents a horizontal bar chart of the populations of the ten most populous countries, based on 2018 estimates from the United Nations World Population Prospects. The visualization uses D3 v5 to load a CSV file with `d3.csv`, then scales the data with `scaleLinear` for the x-axis and `scaleBand` for the y-axis. Axes are generated with `axisLeft` and `axisBottom`, while bars are appended as SVG `rect` elements. Population values are multiplied by 1,000 before rendering.
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