0

Not able to remove legent from Radar Chart in chart.js even using legend: {display : false}. I am using this code and than displaying it with using HTML/JS

below is the code

var options5 = {
  type: 'radar',
  data: {
      labels: [sec1,sec2,sec3,sec4,sec5],
      responsive: false,
      legend :{display:false},
      datasets: [{
        data: [50,70,89,34,100],
        backgroundColor: "transparent",
        borderColor: "rgba(200,0,0,0.6)",
        fill: false,
        radius: 6,
        pointRadius: 6,
        pointBorderWidth: 3,
        pointBackgroundColor: "orange",
        pointBorderColor: "rgba(200,0,0,0.6)",
        pointHoverRadius: 10,
      },
          
      ]
  },
  options :{
   
    
      legend: {
        display: false
     },
    
  }
  
}
new Chart(ctx5, options5);
Jugal
  • 3
  • 1
  • Does this answer your question? [Removing legend from chart.js Radar chart](https://stackoverflow.com/questions/68305021/removing-legend-from-chart-js-radar-chart) – जलजनक Feb 25 '22 at 07:21

2 Answers2

0

Assuming you're using Chart.js version 3, it should be defined as follows:

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

Please consult Chart.js documentation here

uminder
  • 23,831
  • 5
  • 37
  • 72
0

Able to find the solution.Need to use plugin also

options :{
    plugins:{   
      legend: {
        display: false
              },
           }
     }
Jugal
  • 3
  • 1