🌍 Public
Viewing a saved revision (read-only)
9639e83addf247f1bb3c1dcd454c4739
Let's Make a Bar Chart
This example demonstrates a horizontal bar chart of population data for the ten most populous countries, using SVG rectangles scaled proportionally to each country’s population. The visualization imports `csv`, `scaleLinear`, and `scaleBand` from d3 to parse the data and map values to width and band positions. The code loads data.csv, converts population numbers by multiplying by 1000, and appends rectangles to the SVG canvas with widths driven by the linear scale.
AI-generated description