Reputation: 143
I'm using chartjs and I can't hide the labels that show in top of every pie chart. Ex:
And I cannot hide those labels, like AK47, AUG, etc. How can I do it? Thanks!
Upvotes: 0
Views: 377
Reputation: 9372
There's a global setting for this. This will allow you to still have hoverable labels while removing the legend.
Chart.defaults.global.legend.display = false;
Upvotes: 2
Reputation: 15000
A quick way would be to use the legends generateLabels
function to return an empty string
options: {
legend: {
labels: {
generateLabels: function(chart) {
return "";
}
}
}
}
But it does mean you are left with a rather naked looking graph
Upvotes: 1