Is it possible to make highcharts crosshair that vill show actual value on the axis in the separate label?
Regular crosshair example out from API doesnt do this. If I set
tooltip: {
crosshairs: [true, true]
}
, it doesnt do what I need. I need chart to look like this:
Defaulty it is not possible, but you can set mouseover/mouse events and use renderer to add custom shape/object.
http://api.highcharts.com/highcharts#Renderer
This is implemented in the Highstock API, see http://api.highcharts.com/highstock#xAxis.crosshair.label.
In order to use it with Highcharts, just load highstock.js and initialize a regular Highcharts: http://jsfiddle.net/highcharts/vmyau00g/
It's just general idea: http://jsfiddle.net/r7fdh/ - you need to add checking if cursor is inside plot (use
chart.plot[Left/Top/Width/Height]
) and you may need to use something else thanevent.page[X/Y]
for getting position.Code: