Reputation: 1039
I have a chart with scatter series. I had added a event listener for the chart so that on clicking outside of the tooltip, the tooltip will close. But it is not working it seems.
I am using highchart version 4.2.3.
Highcharts.chart('container', {
chart: { events: {
click: function(event) {
var $this = this;
_.each(this.series[0].points, function(p){ $this.tooltip.refresh(p)});
}
}
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul',
'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
tooltip: {
shared: true
},
series: [
{
data: [216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5],
type: 'scatter'
}]
});
Upvotes: 0
Views: 310
Reputation: 5222
As I mentioned in my comment you should be able to use tooltip.hide() for hiding tooltip in your chart.
chart: {
events: {
click: function(event) {
var $this = this;
this.tooltip.hide();
}
}
},
Live example of hiding tooltip with above method: http://jsfiddle.net/buc3pemq/1/
Upvotes: 2