Answers for "remove legend chartjs"

1

chart js hide legend

var myChart = new Chart(ctx, {
   type: 'line',
   data: data,
   options: {
      legend: {
         display: false //This will do the task
      }
   }
});
Posted by: Guest on July-13-2021
0

how to make unclicable legend chartjs

let chart = new Chart(elem.find('canvas')[0], {
                type: 'line',
                data: {
                    labels: [],
                    datasets: []
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    legend: {
                        onClick: (e) => e.stopPropagation()
                    }
                }
            });
Posted by: Guest on October-03-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language