在 Flex 图表的系列基础上设置 dataTipRenderer?
我有一个 Flex LineChart,其中包含三个系列:
- 两个 LineSeries
- 一个 ColumnSet
有没有人见过或听说过一种在每个系列的基础上设置 dataTipRenderer 的方法?您只能覆盖整个图表的它,我不希望仅仅为了达到这种效果而覆盖多个图表。
I have a Flex LineChart which contains three series:
- two LineSeries
- one ColumnSet
Has anyone seen or heard of a way to set the dataTipRenderer on a per-series basis? You can only override it for the entire chart and I would prefer to not have to overlay multiple charts just to achieve this effect.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您找到问题的答案了吗?我想回答 david goshadze 的问题,并建议您看看我做了什么:
有一种方法可以通过数据对象获取系列。您必须为 dataTipRenderer 选择一个实现 IFlexDisplayObject 和 IDataRenderer 的组件(例如 canvas,但它的 mx),然后覆盖数据 getter 和 setter,或者您在自己的 DataTipRenderer 类中实现接口(可选:扩展,例如 VGroup)并实现数据获取器和设置器。现在您可以将数据设置器中的 value 参数转换为 HitData,然后检查元素对象属于哪个类:
现在您知道哪个系列采用渲染器,并且可以渲染单独的数据提示。
希望这有帮助!
do you found a answer for your problem? i want to pick up the question of david goshadze and suggest you to look what i did:
there is a way to get the series by the data object. you have to choose for the dataTipRenderer a component (e.g. canvas but its mx) which implements the IFlexDisplayObject and IDataRenderer and then override the data getter and setter or you implement in your own DataTipRenderer class the interfaces (optional: extends e.g. VGroup) and implement the data getter and setter. now you could cast the value parameter in the data setter to HitData and then check which class the element object is:
now you know which series take the renderer and you can render individual datatips.
hope this helps!