🌍 Public
Viewing a saved revision (read-only)
a22d1f23f4c04c879c46dbc3a4c20cac
Making a bar chart
This example shows a horizontal bar chart ranking ten countries by population, with countries on the y-axis and population values on the x-axis. The code uses D3 v5’s `csv` to load the data, `scaleLinear` and `scaleBand` for scaling, and `axisLeft` and `axisBottom` to render axes. Bars are drawn as SVG `rect` elements, with a steelblue fill, and the chart is fitted within margins inside an SVG canvas.
AI-generated descriptionA bare minimum HTML page.
See also React Starter.