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!
length > 0) { // first check if the tooltip relates to a dataset index we don't want to show if (tooltipsToDisplay. indexOf(active[0]. _datasetIndex) === -1) { // we don't want to show this tooltip so set it's opacity back to 0 // which causes the tooltip draw method to do nothing chartInstance.
The chart legend displays data about the datasets that are appearing on the chart.
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 } }
For me showTooltips = false
didn't work.
My solution was:
Chart.defaults.global.tooltips.enabled = false;
My version is:
2.1.4
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