基于更改 dataProvider 的动画折线图
我需要能够根据 SeriesInterpolate 数据效果对 LineChart 进行动画处理(我将有一个 dataproiders 数组)。我想要一个“播放”按钮,该按钮将:
- 使用数组中的第一个数据提供程序初始化折线图
- 启动动画并等待动画完成,然后加载第二个数据提供程序
- 重复该过程,直到加载数组中的所有数据提供程序
有什么想法吗?
I need to be able to animate a LineChart based on the SeriesInterpolate data effect (I will have an Array of dataproiders). I want to have a "Play" button that will:
- initialize the LineChart with the first dataprovider in the array
- start the animation and wait for the animation to finish before loading the second data provider
- repeat the process until all data providers in the Array are loaded
Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没问题,您只需使用effectEnd事件
因此,在您的效果上,您需要附加effectEnd侦听器,如下所示:
然后在您的代码中,您需要存储数据集以及您要存储的数据集的索引目前正在查看,最后是切换它们的方法。
至于播放按钮,它需要做的就是第一次调用 fetchNextDataset();
有道理吗?
No problem, you're just going to use the effectEnd event
So on your effect, you'll want to attach the effectEnd listener, something like this :
Then in your code, you need to store your datasets, and an index of which you're currently viewing, and finally the method that switches them.
As far as the play button, all it needs to do is make the first call to fetchNextDataset();
Make sense?