Disable tooltip on certain points in Highcharts

2020-02-20 09:15发布

问题:

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.

回答1:

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;
    }
}


标签: highcharts