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
perfect,
i really wants to use this piechart but have 7 piecharts that i have to switch between ,
i haded my radio botumms and add the data in d.apples = +d.apples || 0;
d.oranges = +d.oranges || 0;
d.oranges = +d.ananas || 0;
return d;
this function but i think this is not enough and i beilive it needs an extra function. is any one can tell me how i can do it?