🌍 Public
Viewing a saved revision (read-only)
5917d1b511d14859b076abe985530dea
Let's make a bar chart
This example shows a horizontal bar chart of population figures for eight countries, with the bars sorted alphabetically by country name. The chart is rendered as an SVG using D3 v5. The code loads population data from a CSV file via `d3.csv`, then scales values with `d3.scaleLinear` for the x-axis and `d3.scaleBand` for the y-axis. Axes are drawn using `d3.axisLeft` and `d3.axisBottom`, and each bar is appended as a `rect` element.
AI-generated description