Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turning off animation in HighCharts globally

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?

like image 401
bugmagnet Avatar asked Jul 18 '13 07:07

bugmagnet


2 Answers

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

like image 190
Ricardo Alvaro Lohmann Avatar answered Nov 16 '22 05:11

Ricardo Alvaro Lohmann


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 :)

like image 1
Zuhair Hussain Avatar answered Nov 16 '22 06:11

Zuhair Hussain