Skip to main content
100%

Pie Chart Update, II

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Nov 7, 2011

Clicking the radio buttons in this donut chart switches the displayed metric between apple and orange counts from the `data.tsv` file. The chart uses a `d3.layout.pie` and `d3.svg.arc` to create the donut shape, with paths initially drawn and stored. On selection, the pie’s value function changes, and `transition().attrTween("d", arcTween)` animates the arcs over 750 milliseconds by interpolating between the stored and new angles.

AI-generated description

This variation of a donut chart demonstrates how to update values with an animated transition. Clicking on the radio buttons changes the displayed metric.

Next: Missing Data<br> Previous: Static Update

gpl-3.0 Licensed

Similar vizzes