Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I prevent the hover data from displaying in Chart.JS?

I've got a horizontal bar chart that looks like this:

enter image description here

...but like this when I hover it:

enter image description here

I've tried to prevent the "hover data" from displaying like this:

var priceBarChart = new Chart(ctxBarChart, {
    type: 'horizontalBar',
    showTooltips: false,
    data: barChartData,
    options: optionsBar
});

...and like this:

var optionsBar = {
    scales: {
        xAxes: [
            {
                stacked: true
            }
        ],
        yAxes: [
            {
                stacked: true
            }
        ]
    },
    showTooltips: false
};

...but neither works - the scrunched tip displays anyway.

How can I prevent the hover data from displaying in Chart.JS?

like image 851
B. Clay Shannon-B. Crow Raven Avatar asked Dec 22 '25 01:12

B. Clay Shannon-B. Crow Raven


2 Answers

You should add this to your options:

tooltips: {
    enabled: false
}

Codepen example

More information here

like image 132
Zach P Avatar answered Dec 23 '25 20:12

Zach P


Answer in 2022:

options: {
  plugins: {
      tooltip: {
          enabled: false
               },
           }
         },

Documentation here on Charts.js

like image 22
Milo Persic Avatar answered Dec 23 '25 19:12

Milo Persic



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!