Let's make a bar chart
✓ Published3🌍 Public
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 descriptionMIT Licensed