🌍 Public
Viewing a saved revision (read-only)
9b152d5e7a004b8eb98e565054cbde10
Making a Bar Chart
TTsen Hsieh
Last edited Nov 6, 2022
Created on Sep 27, 2022
This example presents a horizontal bar chart of population counts for eight countries, drawn as SVG rectangles. The chart uses D3 v7's `scaleLinear` and `scaleBand` to map population values and country names to positions, with axes formatted using `format` and custom tick labels. Data is loaded from a CSV file via `csv()`, and the bars are rendered by appending `rect` elements to an SVG group.
AI-generated description