Highcharts工具提示



我在typescript react js编码,我有一个高股票图表。我需要帮助的问题是,我需要显示在标签(div框)上面的图形单个到每个系列内绘制的悬停值。这些值与光标在图形上的位置一致。请帮我实现这个目标。

我附上一个图像,以便更好地理解。图像上的虚线是光标目前所在的位置,我想显示的值是:[128.32,49.94,1.01],而不是每个标签名称旁边的"—":['节流阀,波西','Mill Hydr。单位,Gri',注水,Pos']。由于

形象

在点击事件中,您可以使用this.hoverPoint访问最近的点。

chart: {
events: {
click: function() {
console.log(this.hoverPoint)
}
}
},

演示:https://jsfiddle.net/BlackLabel/8eym6jwo/

我能够解决这个问题。感谢每个帮助过你的人。解决方案(用于获得多个绘制序列的点击点)如下:

this.hoverPoints?.map((item_hoverPoints, index_hoverPoints) => {
temp_trackValues[index_hoverPoints] = Number(
item_hoverPoints?.series?.points[this.hoverPoint?.index]?.y
).toFixed(3).toString();
});

感谢

最新更新