No animation when adding points to two serieses in Highcharts

≯℡__Kan透↙ 提交于 2019-12-23 02:56:09

问题


I am adding a new different point to each of two serieses in a chart similar to this example. If I have only one series, it's animated but for two serieses, it's not animated anymore. The x axis labels scroll smoothly though. Is there a way to animate them or is this a limitation?


回答1:


The two animations are tripping each other up. Add each point without redrawing, then redraw the chart.

      series1.addPoint([x, y1], false, true); //false is to not redraw
      series2.addPoint([x, y2], false, true);
      chart.redraw();

See this fiddle.

EDIT:

You can also use

series1.addPoint([x, y1], false, true); //false is to not redraw
series2.addPoint([x, y2], true, true);

and you don't need to chart.redraw();




回答2:


you can redraw the chart after a certain amount points have been added.

series1.addPoint([x, y1], false, true);
series2.addPoint([x, y2], false, true);
chart.redraw();


来源:https://stackoverflow.com/questions/17240930/no-animation-when-adding-points-to-two-serieses-in-highcharts

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