如何在带有辅助系列的图表上显示/隐藏数据提示
我有一个折线图和一个柱形图作为辅助系列。当我将鼠标悬停在该线上时,会出现数据提示。但是,如果我将鼠标移动到仍在线上出现列的位置,则会出现该行和该列的数据提示项。如何获取它以便只显示行的数据提示而不显示列的数据提示?
<mx:AreaChart id="areachart" dataProvider="{data}" showDataTips="true" >
<mx:series>
<mx:AreaSeries id="areaSeries" xField="date" yField="volume" >
</mx:AreaSeries>
<mx:ColumnSeries id="secondSeries" xField="date" yField="name" >
</mx:ColumnSeries>
</mx:series>
</mx:AreaChart>
I have a line chart with a column chart as a secondary series. When I roll over the line, the datatips appear. However, if I move the mouse to a spot where a column appears while still on the line, the data tip item appears for the line AND the column. How do I get it so that I only show datatips for the line but not the column?
<mx:AreaChart id="areachart" dataProvider="{data}" showDataTips="true" >
<mx:series>
<mx:AreaSeries id="areaSeries" xField="date" yField="volume" >
</mx:AreaSeries>
<mx:ColumnSeries id="secondSeries" xField="date" yField="name" >
</mx:ColumnSeries>
</mx:series>
</mx:AreaChart>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
或者,您可以将列的交互属性设置为 false:
这将阻止列响应鼠标输入。
Alternatively you can set the interactive property of the column to false:
This will prevent the columns from responding to mouse input.
子类 AreaChart 并重写 findDataPoints 方法以过滤掉您不需要的数据点:
然后使用这个新类代替 AreaChart。
Subclass AreaChart and override findDataPoints method to filter out the data points you don't want:
And then use this new class instead of AreaChart.