serious_luffy
serious_luffy

Reputation: 419

HighCharts ios Disable Initial Animation

I tried the following:

 let s_animation = HIAnimation()
 s_animation.duration =  2000
plotOptions.series.animation = s_animation 

later this one :

plotOptions.series.animation= false // incompitable type

and

plotOptions.series.animation.duration = 0 // the app crashes

get stuck for several hours. Is there any solution

Upvotes: 1

Views: 435

Answers (1)

D. Pratt
D. Pratt

Reputation: 464

The HighCharts docs are out of date. Though it does say that you can set the animation options to false, this is not actually true.

I think you were close in your implementation, though; the crash was caused by the fact that .series and .series.animation are both nil until you create those plot option objects.

The best (and currently only) way to do this is as follows:

plotOptions.series = HISeries()  // you would set plotOptions.line = HILine() for a line chart
let animation = HIAnimationOptionsObject() // Even though their docs say HIAnimation(), it's the options you can set the duration for
animation.duration = 0 // actually disables the animation, but there is still some lag from view loading and the chart loading, so it will kind of just blip in after a split second.
plotoptions.series.animation = animation

Hope this helps.

Upvotes: 1

Related Questions