bruxo00 bruxo00 - 8 months ago 76
Javascript Question

Hide chart labels

I'm using chartjs and I can't hide the labels that show in top of every pie chart. Ex:

enter image description here

And I cannot hide those labels, like AK47, AUG, etc. How can I do it? Thanks!


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

fiddle example