All examples By author By category About

kjgross

Pie Chart Update, III

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

forked from mbostock's block: Pie Chart Update, III