Turning off animation in HighCharts globally

这一生的挚爱 提交于 2021-02-07 05:43:08

问题


I am using HighCharts for producing multi-panel charts with multiple series. As far as I can tell, the only way to stop the animation is to use an

animation: false 

atrribution for the plotOptions attribute set for each chart, and then again for each series. Is there a way of setting animaiton off by default for all charts drawn?


回答1:


Yes, you have to use Highcharts.setOptions.
This way you can set default options for all your charts.

Highcharts.setOptions({
    plotOptions: {
        series: {
            animation: false
        }
    }
});

http://api.highcharts.com/highstock#Highcharts




回答2:


if still not disabling the animation, after setting

 plotOptions: {
    series: {
        animation: false
    }
 }

in highcharts.js find

plotOptions : {
        line : {
            allowPointSelect : !1,
            showCheckbox : !1,
            animation : {
                duration : 0
            },

Here I have set the animation duration 0, it works :)




回答3:


You can disable the animations globally in highcharts by doing:

chart: {
  animation: false
},

Reference: http://api.highcharts.com/highcharts/chart.animation



来源:https://stackoverflow.com/questions/17716652/turning-off-animation-in-highcharts-globally

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