[Chartjs]-Only display current y-value on ToolTip in chart.js

1👍

Its work for me

for only x values

      tooltips:{
         callbacks: {
    title: function(tooltipItems, data) {
      return '';
    },
    label: function(tooltipItem, data) {
      var datasetLabel = '';
      var label = data.labels[tooltipItem.index];
      return data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];
    }
  }


  }

for only y values

tooltips: {
enabled: true,
displayColors:false,
callbacks: {
    label:(tooltipItem)=>{
        return tooltipItem.parsed;
    },
}

},

Leave a comment