4

我正在使用来自http://www.highcharts.com/的饼图

所以我正在设置这样的数据:

var cars = [];                            
cars.push({name: "Keine Daten", y: 100});                 

piechart.series[0].setData(cars);
piechart.setTitle({text: 'test '+year+' am '+daytime});

但饼图不会显示任何动画。

我如何触发动画!?

4

2 回答 2

2

If you want animation during the set data, you have to update each point separately. In other words, you can use update() function or addPoint()

http://api.highcharts.com/highcharts#Point.update() http://api.highcharts.com/highcharts#Series.addPoint()

于 2013-06-04T15:17:51.827 回答
0

Just trying out @Sebastian Bochan's answer

pie.series[0].addPoint({name: "New Point", y: Math.floor(10 + Math.random() * 30)});

http://jsfiddle.net/mJRMM/2/

于 2013-06-04T15:18:02.103 回答