ios - HighCharts ios 禁用初始动画

标签 ios swift highcharts data-visualization

我尝试了以下方法:

 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/

相关文章:

javascript - Highcharts 不显示小系列

javascript - Highcharts + Plotband 工具提示悬停 + 默认样式

ios - UITableView 上的断断续续的滚动显示来自 URL 的图像

swift - Swift 中的网址图片

swift - 构建包含 MapKit 的应用程序时找不到符号

swift - 我如何在 Swift 2.1 中读取 UnsafeMutablePointer<FILE>

javascript - 如何使用按钮更改 Highstock 图表的主题?

iphone - 带有隐藏菜单的按钮 iPhone

ios - iOS设计中 View 和容器 View 有什么区别?

javascript - 使用 JavaScript 检测应用程序是否已安装在 iOS 上