Skip to main content
100%

pie chart react

✓ Published0🌍 Public
SSuperShreejit
Last edited May 15, 2022
Created on May 15, 2022
Forked from React Starter

This example loads a CSV of CSS color names and their RGB hex values from a GitHub gist, then renders each row as a slice of a pie chart using React and D3’s `pie` and `arc` generators. The chart fills each path with the color’s hex value, producing a full circle of distinct hues. Data is fetched asynchronously with `csv` and stored in React state via `useState` and `useEffect`. The SVG output scales to the full window size, with the pie centered and a fixed outer radius of 250 pixels.

AI-generated description

React Starter code.

MIT Licensed

Similar vizzes