0
我使用Highstock显示时间序列数据,我想获得最近的数据点,以便用户点击图表。有没有API可以做到这一点?highstock图表点击获取最近点
P.S:我知道如何通过获取xAxis值并搜索系列来实现,但我想知道是否有任何内置函数?
谢谢
我使用Highstock显示时间序列数据,我想获得最近的数据点,以便用户点击图表。有没有API可以做到这一点?highstock图表点击获取最近点
P.S:我知道如何通过获取xAxis值并搜索系列来实现,但我想知道是否有任何内置函数?
谢谢
有没有官方API来得到这个。
然而,看看其他来源,你可以找到:runPointActions
方法。您可以使用与共享工具提示或默认工具提示完全相同的解决方案。来源
段:
// Separate tooltip and general mouse events
followPointer = hoverSeries && hoverSeries.tooltipOptions.followPointer;
if (hoverSeries && hoverSeries.tracker && !followPointer) { // #2584, #2830
// get the point
point = hoverSeries.tooltipPoints[index];
// ABOVE LINE IS INTERESTENING, RIGHT? ;) where: index = pointer.getIndex(e),
// a new point is hovered, refresh the tooltip
if (point && point !== hoverPoint) {
// trigger the events
point.onMouseOver(e);
}
}