Making a Bar Chart
✓ Published2🌍 Public
This example shows the populations of the ten most populous countries in 2018, based on United Nations data, as horizontal bars ordered by rank. It demonstrates custom D3 axes with a linear x-scale for population and a band y-scale for country names. The code uses d3.csv to load the data, d3.scaleLinear and d3.scaleBand for scaling, and d3.axisLeft and d3.axisBottom to render the axes within an SVG container.
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. It also demonstrates customization of D3 axes.
MIT Licensed