Skip to main content
Public

Share visualization

Loading preview…

Fork of Pie chart in React & D3 - 1st attempt

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Fork of Pie chart in React & D3 - 1st attempt

0
Yyingzhe-z
Last edited Apr 2, 2021
Created on Apr 2, 2021

This example presents a React and D3-based pie chart with four slices, rendered as SVG paths. The pie segments are colored using a color gradient interpolation between warm tones, applied proportionally across the slices. The chart positions a donut-like ring with an inner radius of 180 and an outer radius of 250, centered within a 960 by 500 pixel viewport. The implementation combines React components with d3’s `pie` and `arc` functions to compute the slice geometry, alongside `d3.interpolateRgb` for color transitions. A separate, commented-out `Check` component demonstrates an alternative color interpolation approach.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed