Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Pie chart in React & D3 - 1st attempt

Public visualization

Viewing a saved revision (read-only)

45b9cb60c3b24fa183a3d0a02fe3c235

Pie chart in React & D3 - 1st attempt

0 stars14🌍 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