1var myChart = new Chart(ctx, {
2 type: 'line',
3 data: data,
4 options: {
5 legend: {
6 display: false //This will do the task
7 }
8 }
9});
1// How to implement a custom behaviour when clicking on a legend element
2var original = Chart.defaults.global.legend.onClick;
3Chart.defaults.global.legend.onClick = function(e, legendItem) {
4 /* do custom stuff here */
5 original.call(this, e, legendItem);
6};