🌍 Public
Viewing a saved revision (read-only)
03f3b9d9918e436f8cb177f8fd46b80b
Making a Bar Chart
This example shows a horizontal bar chart ranking the ten most populous countries, with bars colored by country and labeled along a bottom axis. The chart uses D3.js scales (`scaleLinear`, `scaleBand`, `scaleOrdinal`) to map population values and country names, while `d3.axisLeft` and `d3.axisBottom` render the axes. Population data is loaded from a CSV file via `d3.csv`, multiplied by 1000 in the code, and rendered as SVG rectangles. The visualization highlights D3’s core data-binding and SVG generation workflow.
AI-generated description