🌍 Public
Viewing a saved revision (read-only)
2bd3c0c48c9e48989b0a907f620f70f6
Making a bar chart
This example shows a horizontal bar chart of population data for the ten most populous countries, drawn as SVG rectangles scaled by population and ordered by country name. It uses D3 v7’s `scaleLinear` for the x-axis, `scaleBand` for the y-axis categories, and `axisLeft` and `axisBottom` to render ticks. The chart loads data from `data.csv` via `d3.csv`, converts population values to numbers, and appends the rectangles with a fixed steelblue fill.
AI-generated descriptionT