Chartjs-How to disable a custom tooltip for a dataset in Chart.js line chart?

0👍

You can filter tooltips:

tooltips: {
    enabled: true,
    filter: function (tooltipItem) {
        var dSet = tooltipItem.datasetIndex;
        if (dSet == 1) {  // <-- dataset index
            return false;
        } else {
            return true;
        }
    },
    // (....)

EDIT:
To hide custom tooltips you need to check the dataset from your tooltip function:

var customTooltips = function(tooltip) {
    if(tooltip.hasOwnProperty('dataPoints') && tooltip.dataPoints[0] != 'undefined'){
        if(tooltip.dataPoints[0].datasetIndex == 0) // <-- dataset index
            return;
    }

Leave a comment