Chart.js v2 hide dataset labels
Just set the label
and tooltip
options like so
...
options: {
legend: {
display: false
},
tooltips: {
callbacks: {
label: function(tooltipItem) {
return tooltipItem.yLabel;
}
}
}
}
Fiddle - http://jsfiddle.net/g19220r6/
add:
Chart.defaults.global.legend.display = false;
in the starting of your script code;
As of 2021, the namespace has changed from options.legend
to options.plugins.legend
. This simple code worked for me -
data{
...
},
options: {
plugins: {
legend: {
display: false
}
}
}