🌍 Public
Viewing a saved revision (read-only)
f2fce4cece8f4c728440bf1899afae15
Making a bar chart with D3.js
This example shows a horizontal bar chart of population per country, with country names labeled along the vertical axis and population values on the horizontal axis. The chart renders population data for eleven countries, sourced from WorldoMeter, as SVG rectangles using D3.js v5 within a React framework. It uses `d3.csv` to load the data, `scaleLinear` and `scaleBand` for scaling, `axisLeft` and `axisBottom` for ticks, and `select` to append elements to the SVG container.
AI-generated descriptionA bare minimum HTML page.
See also React Starter.
Bar chart of population per country taken from the WorldoMeter.