Chartjs-How can i hide label data on chart.js tooltip content?

0๐Ÿ‘

Had you tried labels: "priceDate", ?

Could this be working (instead of corrupting the retriever)?

options: {tooltips: {enabled: true, dateTimeLabelFormats: {day: '% %, %'}},

0๐Ÿ‘

You can use formatter function within tooltip, and inside the function, you have access to this which you can get the data you want.

Here is an example:

  tooltip: {
    formatter: function() {
      return `${this.y} ${this.series.name}`;
    }
  },

0๐Ÿ‘

Use the tooltip.headerFormat or tooltip.formatter callback to customize tooltip output.

API: https://api.highcharts.com/highcharts/tooltip.headerFormat

API: https://api.highcharts.com/highcharts/tooltip.formatter

0๐Ÿ‘

better use tooltipformatter. there you can format how the tooltip should display data.
hereโ€™s a link to jsfiddle which shows only data and no label.

0๐Ÿ‘

I solved issue with callback function.

tooltips: {
callbacks: {
 title: function() {}
},
enabled: true}

0๐Ÿ‘

For ChartJS v4

plugins: {
    tooltip: {
        callbacks: {
            title: function() {
                return null;
            }
        }
    }
}

Leave a comment