🌍 Public
Viewing a saved revision (read-only)
4c7b9a8ea12445e7a79cb658fef0fd36
Making a bar chart
This example shows a horizontal bar chart of the ten most populous countries, ordered by population. It uses D3 v5’s `scaleLinear` and `scaleBand` to map population values and country names to SVG rectangles, with `axisLeft` and `axisBottom` for axes. Population data is loaded from a CSV file and formatted in billions using `format('.3s')`. The chart includes a title and axis labels, with the x-axis gridlines extending across the plot area.
AI-generated description