score:13

Accepted answer

i found the solution on the chartjs repository on github.

the solution is to use the option multitooltiptemplate if your graph has multiple data. otherwise, you should use tooltiptemplate

multitooltiptemplate: "<%=datasetlabel%> : <%= value %>"  // regular use
// or
multitooltiptemplate: "<%%=datasetlabel%> : <%%= value %>"  // ruby on rails use

will give you :

  • dataset_label : value

score:7

try this one, it will work. you just need to check what's the data coming in the label function.

options: {
  tooltips: {
    callbacks: {
      title: function() {
        return "";
      },
      label: function(item, data) {
        var datasetlabel = data.datasets[item.datasetindex].label || "";
        var datapoint = item.ylabel;
        return datasetlabel + ": " + datapoint + "min";
      }
    }
  }
}

Related Query

More Query from same tag