Aqqqq
Aqqqq

Reputation: 848

Is it possible to trigger tooltip in highchart of a line chart ONLY when the mouse hovers over the point?

The default behavior is that the tooltip of the point closest to the mouse will appear whenever the mouse enter the chart area.

Upvotes: 0

Views: 468

Answers (1)

morganfree
morganfree

Reputation: 12472

It might be difficult to achieve in a line chart - you would need to manually calculate if the mouse position is exactly over the point and depending on this displaying a tooltip or not.

However, you can mock a line chart with a scatter chart with lineWidth > 0. Disable sticky tracking and it results with what you are looking for.

Highcharts.chart('container', {
    series: [{
        type: 'scatter',
        lineWidth: 1,
        stickyTracking: false,
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
    }]
});

Live example

http://jsfiddle.net/6yc6jn5w/

Upvotes: 3

Related Questions