block by mbostock 5681842

Pie Chart Update, III

Full Screen

The easiest way to transition between pie charts with differently-sized datasets (while maintaining object constancy) is to set the missing values to zero.

function type(d) {
  d.apples = +d.apples || 0;
  d.oranges = +d.oranges || 0;
  return d;
}

Next: Static Data-Join
Previous: Animation

index.html

data.tsv