Flex 图表——如何在鼠标悬停时更改图表项的颜色?
有没有办法为图表中的每个系列设置翻转颜色?
例如,我有一个包含两个系列的柱形图:一个系列设置为蓝色,第二个系列设置为金色。
当用户将鼠标悬停在蓝色系列上时,我希望蓝色变为亮蓝色。当用户将鼠标悬停在金色系列上时,我希望金色变成亮金色。
另外,单击图表项目时是否可以更改图表项目的颜色?
谢谢,
莱西
Is there a way to set a rollover color for each series in a chart?
For instance, I have a column chart with two series: one series is set to blue and the second series is set to gold.
When the user mouses over the blue series, I would like the blue to turn to bright blue. And when the user mouses over the gold series, I would like the gold to turn to bright gold.
Also, is it possible to change the color of the chart item when a chart item is clicked?
Thanks,
Lacy
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
quietlyscheming 有很多优秀的例子。基本上,您需要为该系列创建自己的 itemRenderer 并捕获鼠标在其上移动并更改状态或颜色。这是一条有据可查的路径。
quietlyscheming has a lot of excellent examples. Basically you need to create your own itemRenderer for the series and trap the mouse moving over it and change states or colours at it does. This is a very well documented path.