I have a Highcharts line chart going and I have tooltips enabled, however, I would like to disable tooltips for the certain case where x=0. Is there a way of doing this? The closest that I have come so far is this:
tooltip: {
formatter: function() {
if (this.x > 0) {
return this.x;
}
else return null;
}
}
This just creates an empty tooltip but there is still a popup.
Return false to disable tooltip for a specific point on series.
The tooltip appears when hovering over a point in a series. By default the tooltip shows the values of the point and the name of the series. For the full set of options available for the tooltip, see the API reference.
A callback function for formatting the HTML output for a single point in the tooltip. Like the pointFormat string, but with more flexibility. Defaults to undefined . Context: Highcharts. Point.
Ok...just figured it out. I just have to return false
instead of null
.
tooltip: {
formatter: function() {
if (this.x > 0) {
return this.x;
}
else return false;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With