Skip to main content
100%

Let's make a bar chart with D3.js

✓ Published2🌍 Public
Llinkshady
Last edited Oct 16, 2020
Created on May 14, 2020

This example shows a bar chart of country populations from a CSV file, using D3.js v5 within a React project. The chart renders as an SVG with `rect` elements scaled by `d3.scaleLinear` for the y-axis and `d3.scaleBand` for the x-axis, alongside `d3.axisLeft` and `d3.axisBottom` for tick marks. Data is loaded asynchronously via `d3.csv`, with population values converted to thousands, and margins are applied inside a main `<g>` group.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes