Chartjs-Chart.js – hide / remove label on second dataset

0👍

Managed to figure out the answer. There were 86 items in both data sets & the second dataset started at an index of 43. It’s a pretty ugly solution, but it works. Add the below in the options section.

tooltips: {
    filter: function (tooltipItem, data) {
        var label = data.labels[tooltipItem.index];                           
        if (tooltipItem.datasetIndex > 42) {
            return false;
        } else {
            return true;
        }
    }
}

Leave a comment