Skip to main content
100%

Axes with React & D3

✓ Published1🌍 Public
KK3zter
Last edited Dec 17, 2021
Created on Dec 17, 2021

This example shows a horizontal bar chart of the top 10 countries by 2020 population, rendered as SVG through React components. React state tracks the data, initially loaded via `d3.csv`, while `scaleBand` and `scaleLinear` position bars and axes. The chart includes manually drawn tick marks and labels for both axes. The code uses React `useState` and `useEffect` hooks, along with D3’s `max` for scaling.

AI-generated description

Loads in some data using D3 and uses react state to track the data

MIT Licensed

Similar vizzes