🌍 Public
Viewing a saved revision (read-only)
c182dc2ca46f442b864f4fac52105e10
Making a Bar Chart
This example shows a horizontal bar chart ranking countries by population, using a CSV dataset of ten nations. The bars are rendered as SVG rectangles, with each country’s population scaled linearly across the chart width and country names positioned along a band scale. The code loads data with `d3.csv`, converts population values to thousands, and builds the chart using `d3.scaleLinear`, `d3.scaleBand`, and `d3.max` for domain calculation.
AI-generated description