Fork of Making a Bar Chart
This example displays the top 10 most populous countries as a horizontal bar chart, using year 2018 estimates from the United Nations World Population Prospects. Population values are multiplied by 1000 and encoded as bar widths via `d3.scaleLinear`, while country names are placed on a `d3.scaleBand` y-axis. The chart customizes D3 axes by removing domain lines, adding tick marks, and formatting tick labels to abbreviate large numbers (e.g., “1.4B”). Data is loaded from a CSV using `d3.csv`, and the SVG is rendered with D3 v5 selections.
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.