gRaphael Pie Chart : Add animation

浪子不回头ぞ 提交于 2019-12-19 10:13:47

问题


I want to display the pie chart with an animation that will make it grow from a "small point" to full size pie chart , something like this growing pie or this Highcharts Demo Gallery - Pie , but I want to apply it to a pie made with gRaphael ,

Here's my jsfiddle example... raphael pie chart with legend

Thanks ahead,


回答1:


In order to achieve that kind of animation you have to access the sectors and... animate them :)

You can do this using your_pie.each()

pie.each(function(){
  //scale each sector to 0
  this.sector.scale(0, 0, this.cx, this.cy);
  //animate from 0 to default size
  this.sector.animate({ transform: 's1 1 ' + this.cx + ' ' + this.cy }, 1000, "bounce");
});

The fiddle is here: http://jsfiddle.net/85VtZ/6/

Have fun ;)



来源:https://stackoverflow.com/questions/10798909/graphael-pie-chart-add-animation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!