Making a Bar Chart
✓ Published0🌍 Public
This example presents a horizontal bar chart of the top 10 most populous countries using 2018 data from the United Nations World Population Prospects. The bars are rendered as SVG rectangles with a steelblue fill, and the chart includes customized D3 axes: a left axis with country names and a bottom axis with formatted population labels. The code uses D3 v5 APIs such as `scaleLinear`, `scaleBand`, `axisLeft`, `axisBottom`, and `format` to load the CSV, compute scales, and draw the visualization.
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