问题
charts/stack-overflow,
I would like to make it easy for end users to compare points in an area/line chart. As such, when they hover on a point, I would like to draw a horizontal line from that point all the way to the left and to right. Unlike a plotLine (which i understand to be static), this would be appear/disappear/change based on which point you are hovering on.
You can see something similar on the stockcharts where a vertical line goes down to the X-axis.
Any ideas?
回答1:
Use yAxis.crosshair
:
yAxis: {
crosshair: {
...
}
}
Live demo: http://jsfiddle.net/BlackLabel/6m4e8x0y/5003/
API Reference: https://api.highcharts.com/highcharts/yAxis.crosshair
来源:https://stackoverflow.com/questions/61702783/line-to-the-y-axis-on-hover