Skip to main content
100%

D3 React bar chart

✓ Published1🌍 Public
MMarco Malvicini
Last edited Apr 17, 2021
Created on Apr 17, 2021

This example displays a horizontal bar chart of the top ten countries by 2020 population, using data loaded from a CSV file via `d3.csv`. A React component manages the loaded data with `useState` and `useEffect`, while D3’s `scaleBand` and `scaleLinear` map countries and population values to SVG coordinates. The chart renders SVG rectangles and grid lines, with axes omitted, and includes a loading message before data arrives.

AI-generated description

A program that loads in some data using d3 utilities and use react state to store the data

MIT Licensed

Similar vizzes