我尝试了以下方法:
let s_animation = HIAnimation()
s_animation.duration = 2000
plotOptions.series.animation = s_animation
稍后这个:
plotOptions.series.animation= false // incompitable type
和
plotOptions.series.animation.duration = 0 // the app crashes
卡了几个小时。有什么解决办法吗
最佳答案
HighCharts 文档已过时。虽然它确实说您可以将动画选项设置为 false,但实际上并非如此。
不过,我认为您的实现很接近;崩溃是由于 .series 和 .series.animation 在您创建这些绘图选项对象之前都为 nil 的事实引起的。
最好的(也是目前唯一的)方法如下:
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
希望这对您有所帮助。
关于ios - HighCharts ios 禁用初始动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52532705/