我的 Angular 应用程序出现问题。我必须创建一个包含多个系列的图形,并显示带有 x 和 y 值以及与 x 和 y 不同的点 id 的工具提示。
为了收集数据,我创建了一个点对象数组,如下所示:
pointobject = {
x: data.measurementIds[el.x].date,
y: el.y,
id: el.x
}
我将它插入我的数组points
,并创建一个类似对象的临时系列。完成此操作后,我将其插入系列数组并将其添加到我的 highcharts 配置对象中。
问题是:我如何在工具提示配置部分访问当前悬停的点 ID?
最佳答案
我找到了如何获取我的 id :this.points[0].point.id
。
我复制/粘贴 Pawel 评论以获取更多详细信息:
If you have disabled dataGrouping, then use (for shared tooltip):
this.points[0].point.options.id.
With enabled dataGrouping you don't have access to id, since a couple of points are grouped into one, and such information isn't available (question is: how to find average of:"a"
,"v"
and"t"
letters?).
关于javascript - 访问悬停点数据系列 highstock,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31310968/