Making a Bar Chart
✓ Published0🌍 Public
This example displays the top 10 most populous countries using horizontal bars, with population values from the United Nations’ 2018 estimates. The custom D3 axes include a reformatted x-axis that abbreviates numbers like “1.4B” and grid lines. The chart loads data from a CSV file, scales it with d3.scaleLinear and d3.scaleBand, and renders SVG rectangles. Stylized with custom margins and axis labels, it uses d3.csv and d3.axisBottom/axisLeft for layout and tick generation.
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