[Chartjs]-ChartJs – Is is possible to show only tooltip in one dataset?

1👍

You can check the type and disable it as,

tooltips: {
          filter: function (tooltipItem, data) {
              var type = data.type;
              if (type == "Bar") {
                return true;
              } else {
                return false;
              }
          }

1👍

Edited Sajeetharan’s code and this works for me:

    tooltips: {
      filter: function (tooltipItem, data) {
        const type = data.datasets[tooltipItem.datasetIndex].type;
        if (type === 'bar') {
          return true;
        } else {
          return false;
        }
      }
    }

Leave a comment