Skip to main content
100%

Pie Chart Update, II

✓ Published0🌍 Public
SSpaceActuary
Last edited Jun 5, 2017
Created on Jun 5, 2017

A donut chart displays two metrics—apples and oranges—for a set of categories. The chart animates between the two datasets when a radio button is selected or after a two-second automatic switch. The code uses `d3.layout.pie` to compute angles, `d3.svg.arc` for the donut shape, and `transition.attrTween` with an interpolated arc function to smoothly update the paths’ rendered angles. Data is loaded from a TSV file with `d3.tsv`.

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

forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/1346410'>Pie Chart Update, II</a>

gpl-3.0 Licensed

Similar vizzes