13π
β
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
8π
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";
}
}
}
}
Source:stackexchange.com