54
votes

I'm trying to hide the tooltips in a line chart using chart.js.

I have tried this code, but they never hide.

Chart.defaults.global.tooltipenabled = false;

You can see all the code here of the chart:

https://jsfiddle.net/w6zs07xx/ Thanks!

6
There is nothing in jsfiddle. please recreate. - Sagar R
@SagarR sorry added it in now - user1937021
after checking your jsfiddle i found that you are using old version of chart.js file in which there was a bug regarding TOOLTIP that why it's not hiding that. (Reference site : github.com/chartjs/Chart.js/issues/494) - Sagar R

6 Answers

103
votes

To turn off for a specific chart instead of in global defaults use this in the options object. Using v2.5.0

options: {
    tooltips: {
         enabled: false
    }
}
16
votes

For me showTooltips = false didn't work.

My solution was:

Chart.defaults.global.tooltips.enabled = false;

My version is:

2.1.4

8
votes

You have the wrong property name. It should be

Chart.defaults.global.showTooltips = false;

Fiddle - https://jsfiddle.net/0tfvnmx1/

4
votes

use the following option for hide the tooltip

 tooltips :{
                custom : function(tooltipModel) 
                 {
                  tooltipModel.opacity = 0;
                 }
           }
4
votes

For v2.9.3:

options: {
    tooltips: false
}
0
votes

For 3+ the path is options.plugin.tooltip.enabled.