将系列添加到 Flex 图表中时是否会调度事件?
我想知道数据何时添加到图表中,以便我可以使用 localToData()
在图表上绘图。如果我在设置 dataProvider 后立即执行此操作,则图表尚未更新,因此对 localToData 的调用将不会返回正确的值。是否有一个我可以订阅的事件,以便我知道图表已在 dataProvider 中绘制数据?
I want to know when the data has been added to a chart so I can use localToData()
to draw on the chart. If I do this immediately after setting the dataProvider the chart has not yet updated, so the the call to localToData will not return the correct values. Is there an event I can subscribe to so I know the chart has drawn the data in the dataProvider?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有一个 CollectionChanged 事件,这样你就可以听了。此外,可以使用图表组件中的initialize/creationComplete 事件来获取初始数据。
There is a CollectionChanged event, so you can listen to it. Also, initial data can be fetched using initialize/creationComplete event in the Chart component.
updateComplete 事件虽然不严格为此,在调用系列
updateDisplayList
方法后会触发,这已经足够接近了。The updateComplete event whilst not strictly for this purpose, does fire after the series
updateDisplayList
method has been called, which is close enough.