Making a Bar Chart
✓ Published0🌍 Public
This example displays a horizontal bar chart of the populations of the ten most populous countries, based on 2018 United Nations estimates. The chart uses D3 v7 with SVG rendering, relying on `scaleLinear` for the x-axis and `scaleBand` for the categorical y-axis. Data is loaded from a CSV file with `csv()`, and axes are drawn via `axisBottom` and `axisLeft`. Bars appear in steelblue, with dimensions mapped from population values and country names.
AI-generated descriptionThis barchart shows population of the top 10 most populated countries. The data comes from the year 2018 estimate in United Nations: World Prospects 2017.
MIT Licensed