Reputation: 1838
Here (see this jsfiddle) you can see the 2-dimensional crosshairs are snapping to the datapoint that is closest to it. How would you make the crosshairs and tooltip correspond to the current mouse position on the chart?
tooltip: {
crosshairs: [true, true]
}
Upvotes: 6
Views: 7573
Reputation: 21
You can try it Set axis crosshair for mouse move
$('#container').highcharts({
xAxis: {
crosshair: {
snap: false
}
},
yAxis: {
crosshair: {
snap: false
}
},
series: [{
data: [6, 4, 2,4],
name: 'First'
}, {
data: [7, 3, 2],
name: 'Second'
}, {
data: [9, 4, 8],
name: 'asdf'
}]
});
Upvotes: 2
Reputation: 396
I ended up binding my own mousemove event to get the constantly changing mouse position within the graph for the crosshairs. For the tooltip i just used:
tooltip: {
shared: true,
followPointer: true
},
This should be more than enough to get you going.
Upvotes: 10
Reputation: 37578
Unfortunately crosshair works only in this way, but you can prepare your own solution by mouseOver and mouseOut events and add draw line by renderer.
http://api.highcharts.com/highcharts#plotOptions.series.events.mouseOver http://api.highcharts.com/highcharts#plotOptions.series.events.mouseOut
http://api.highcharts.com/highcharts#Renderer
Upvotes: 2