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);
}
}