Skip to main content
100%

Making a Bar Chart with React & D3

✓ Published1🌍 Public
BbeauMarko
Last edited Jan 27, 2021
Created on Jan 27, 2021

This example shows a horizontal bar chart of country populations, with each bar’s length proportional to its population value from a local CSV file. The visualization combines React’s `useState` and `useEffect` hooks to asynchronously load data via `d3.csv`, while `d3.scaleBand` and `d3.scaleLinear` map country names and population counts to SVG rectangle positions and widths. The chart renders as an SVG using React components, with `d3.max` determining the x-axis scale domain.

AI-generated description

A program that loads in saome data using d3 utilities and uses React to keep track of the data.

MIT Licensed

Similar vizzes