[Chartjs]-Remove radar chart labels in chart.js

7πŸ‘

βœ…

var myNewChart = new Chart(ctx, {
            type: "radar",
            data: radarData,
        });
        myNewChart.options.title.text = "top of chart";   // test, total fail
        myNewChart.options.legend.display = false;        // This one does it!

So apparently on the radar chart, that top element is called the legend. I was able to place a watch on myNewChart object in Chrome and step thru the code in dev tools.

4πŸ‘

Keep in mind that in Chart.js version 3, the options now have a plugins inner field, in which such options are to be configured.
So now it is:

options:{
      plugins:{
         legend:{
            display:false
         }
      }
   }

Or programmatically:

myNewChart.options.plugins.legend.display = false;

Leave a comment