Mubbasher Khaliq
Mubbasher Khaliq

Reputation: 379

Scatter tooltip of highchart is not being displaying

I have a highchart of scatters and bars . I am unable to view tooltip of a scatter point which is over bar... here is the fiddle http://jsfiddle.net/tZ9Rt/

I am using these two series:

series: [{
        type: 'scatter',
        index:2,
        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],
        name: 'Temperature'
    }, {
        type: 'column',
        index:1,
        data: [220,220,220,220,120,220,220,220,220,220,220,220],
        name: 'Rainfall'
    }]

Any help is highly appreciated...

Thanks

Upvotes: 4

Views: 3336

Answers (3)

John Zwinck
John Zwinck

Reputation: 249434

Make your tooltip shared, and change the series type to 'line' and lineWidth to 0. Then you'll have a "line" chart that looks like a scatter plot, but tooltips work!

tooltip: {
    shared: true //make the tooltip accessible across all series
},
plotOptions: {
    line: {
        lineWidth: 0 //make the lines disappear
    }
},
series: [{
    type: 'column',
    name: 'Column Data',
    data: [5, 4, 3, 2, 1, 0]
}, {
    type: 'line', //this is a 'fake' scatter plot
    name: 'Pseudo-scatter',
    data: [0, 1, 2, 3, 4, 5]
}]

Upvotes: 13

Sebastian Bochan
Sebastian Bochan

Reputation: 37588

It is known bug, reported here: https://github.com/highslide-software/highcharts.com/issues/923

Upvotes: 1

Linger
Linger

Reputation: 15058

The reason you are unable to view the tooltip for the scatter points over the bar is because the bar gains focus before the scatter point. The bar will maintain the focus of the tooltip until the mouse is no longer over the bar. You could always use a shared tooltip like in this example. By doing so it will show all the data associated with the category your mouse is hovering over. Here is the relevant code:

tooltip: {
  shared: true            
},

Upvotes: 0

Related Questions