Skip to main content
100%

Pie chart in React & D3 - 1st attempt

✓ Published14🌍 Public
BbeauMarko
Last edited Mar 5, 2021
Created on Feb 11, 2021
Forked from React Starter

This example shows a donut-style pie chart built as a React component, with four slices colored along a gradient from orange to deep pink using `d3.interpolateRgb`. It relies on `d3.pie()` to compute the slice angles and `d3.arc()` with both inner and outer radii to generate SVG `<path>` elements. The chart is rendered inside a `<g>` group translated to the center of an SVG canvas, with a commented-out companion component that would draw color swatches via `d3.interpolateRgb` for testing.

AI-generated description
MIT Licensed

Similar vizzes