带有堆积面积图的绘制线下面积的工具提示
我有一个堆积面积图(下面包含一个示例),每次鼠标悬停在两条线之间的区域时,我希望显示一个工具提示,其中显示上一行最近点的数据。
我完全不知道如何做到这一点,并且我的搜索查询未能成功找到潜在的解决方案。我只能在绘制线的实际点上制作工具提示,而不能在它们之间的区域上制作工具提示。
您知道如何做吗?
先感谢您 !
图表示例:图表示例
I have a stacked area chart (an example is included below) where I would like to have a tooltip with the upper line's nearest point's data appear every time the mouse hovers an area between two lines.
I have absolutely no idea on how to do this and my search queries were unsuccessful into finding a potential solution. I can only make a tooltip on the actual points of the plotted lines but not on the areas between them.
Do you have any idea on how to do it ?
Thank you in advance !
Example of chart : Example of chart
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个Flot示例似乎可以满足您的要求: http://people.iola.dk /olau/flot/examples/interacting.html。
根据此代码,使用 jQuery 在显示点数据的光标位置添加工具提示应该非常简单。但是,您可能最好显示光标的坐标(时间和值,或其他),并且仅对数据提供的点使用工具提示。
This Flot example seems to do what you want: http://people.iola.dk/olau/flot/examples/interacting.html.
It should be pretty straightforward, based on this code, to use jQuery to add a tooltip at the location of the cursor that displays the point's data. However, you might be better off displaying the coordinates of the cursor (time and value, or whatever) and only using a tooltip for the points provided by your data.