🌍 Public
Viewing a saved revision (read-only)
b136551d81bf456582b3560da3909d22
Making a bar chart
This example shows a horizontal bar chart of the ten most populous countries, with each bar’s length representing population in thousands. It uses D3 v5’s `scaleLinear` for the x-axis, `scaleBand` for the categorical y-axis, and `axisLeft` and `axisBottom` for the tick marks and labels. The SVG-based visualization loads data from a local CSV file via `d3.csv`, converts the population values with a unary plus operator, and appends rectangles to a group element with explicit margins.
AI-generated description