d3工具提示/弹出多个数据系列?(d3 tooltip/popup for multiple data series?)

编程入门 行业动态 更新时间:2024-10-28 04:27:08
d3工具提示/弹出多个数据系列?(d3 tooltip/popup for multiple data series?)

我正在寻找一种在d3中显示工具提示/弹出窗口的方法,该工具提示/弹出窗口显示特定时间戳的所有数据。 我一次显示多达五个数据系列,有时但并非总是如此,在同一时间戳中有来自两个或更多数据系列的数据,以及我想在沿x轴移动鼠标时显示的数据。

可以这样做吗?

I'm looking for a way to display a tooltip/popup in d3 that shows all data for a certain timestamp. I'm displaying up to five data series at once and sometimes, but not always, there are data from two or more data series at the same timestamp, and those I want to show when move the mouse along the x-axis.

Can this be done?

最满意答案

我的问题的解决方案是编写一些自己的函数,首先获取x位置,然后单击图表,将其转换为有效的时间戳。 然后匹配数据库中最近的实际时间戳。 然后我将rect显示为一个窗口,其中包含该时间戳记中包含该时间戳数据的所有系列的数据。

My solution for my problem was to write some own functions that first get the x-position where I click on the chart, convert that to a valid timestamp. Then matching with nearest actual timestamp in the dataseries. Then I show a rect as a window with the data at that timestamp for all series that has data at that timestamp.

更多推荐

本文发布于:2023-07-31 15:54:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1344963.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   弹出   提示   工具   系列

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!