问题
I am using a piechart from http://www.highcharts.com/
So i am setting the data like this:
var cars = [];
cars.push({name: "Keine Daten", y: 100});
piechart.series[0].setData(cars);
piechart.setTitle({text: 'test '+year+' am '+daytime});
But the piechart wont show any animation.
How do i trigger the animation!?
回答1:
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()
回答2:
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/
来源:https://stackoverflow.com/questions/16921075/highcharts-piechart-redraw-with-animation-after-setdata