🌍 Public
Viewing a saved revision (read-only)
ad6d0c7223504c43b0244e5895d4cb02
Let's make a bar chart with D3.js
This example shows a bar chart of country populations using D3.js, with each bar’s height scaled linearly from the population values and positioned along a categorical axis for country names. It renders entirely as SVG, using `scaleLinear` for the y-axis, `scaleBand` for the x-axis, and `axisLeft` to draw tick marks. Population data comes from a CSV file loaded via `csv`, and the bars are appended as `rect` elements with a steelblue fill. The chart uses margins to place the plot area within a fixed 960×500 SVG canvas.
AI-generated descriptionA bare minimum HTML page.
See also React Starter.