Skip to main content
100%

Let's make a bar chart with D3.js

✓ Published0🌍 Public
Xx1umao
Last edited Oct 18, 2020
Created on Oct 18, 2020

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 description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes