g.raphael
g.raphael copied to clipboard
How to animate pie slices?
How can I animate the angle of a pie slice? I want the chart fold in on itself.
I see it's been done here: http://raphaeljs.com/growing-pie.html
But that doesn't use g.raphael at all. Is there a way to do this?
Or even just to change a value and transition the change.
It's possible to do it with the below code :
var r=Raphael("my-div");
var pie = r.piechart(wdth, hght, 70, values, { legend: labels, legendpos: "east" });
pie.each(function() {
this.sector.scale(0, 0, this.cx, this.cy);
this.sector.animate({ transform: 's1 1 ' + this.cx + ' ' + this.cy }, 1000, "bounce")
})