Is it possible to have tool tip on clicking of points instead of mouse move.
I have tried with showing values in java script alert as below
plotOptions: {
series: {
cursor: 'pointer',
point: {
events: {
click: function() {
alert ('Category: '+ this.category +', value: '+ this.y);
}
}
}
}
}
Requirement is to show high chart tool tip on click.
Please help. Thanks!
As @PawelFus states, it's not officially supported but you can fudge this in by taking control of the visiblity of the tooltip.
First on chart load, hide it:Disable sticky tracking, and on mouseout hide it, on click show it:
Here's a fiddle example.
First attempt only worked in chrome, here's another:
Disable the default tooltip:
In the chart load event, create your own:
In the click and mouseout control it:
I tested this in IE and Chrome, I won't install Firefox anymore.
Update to code 9/7/2017 with new stack snippet:
Adding for those who has problems like me with
useHTML: true
and wants to display tooltip only on click and not on hover.Here is a fiddle.
Here is the fix for "Cannot read category of undefined". I just take hovered points of chart and pass them to refresh.
Sample fiddle here: http://jsfiddle.net/2swEQ/153/
Just add for those who has the same problems as myself (see comment from @kevinandrada just after correct answer, i can't comment): if you call
tooltip.refresh
when yourtooltip.shared = true
you'll get an exceptionUncaught TypeError: Cannot read property 'category' of undefined
.You should provide an array of points as a first argument: