🌍 Public
Viewing a saved revision (read-only)
51ea4f8fde0846f1bffc2f1e71523aac
Making a Bar Chart
This example shows a horizontal bar chart of population counts for major world regions, using a bar’s length to encode each region’s population value. The visualization renders as SVG rectangles positioned with a `d3.scaleBand` y-scale and sized with a `d3.scaleLinear` x-scale, both fed from a CSV file read via `d3.csv`. Data values are coerced to numbers before scaling, and the chart fills the full SVG dimensions defined in the HTML. React and D3 v5 work together, with selections and scales imported directly from the `d3` package.
AI-generated descriptionReact Starter code.