I am trying to hide a legend in a bar chart, but setting the display to false is no working… Am I doing something wrong?
LABELS
const labels = ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul'];
return labels;
DATASET
const datasets = [{
label: 'Fatruamento NE',
data: [65, 59, 80, 81, 46, 65, 64],
backgroundColor: [
'rgba(75, 192, 192, 1)',
'rgba(255, 205, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(75, 192, 192, 1)',
'rgba(255, 99, 132, 1)',
'rgba(201, 203, 207, 1)',
'rgba(201, 203, 207, 1)'
]
}];
return datasets
OPTIONS
const config = {
type: 'bar',
options: {
plugins: {
legend: {
display: false // << PROBLEM IS HERE
},
tooltip: {
callbacks: {
title: () => null
}
}
},
scales: {
x: {
ticks: {
color: '#000'
},
grid: {
drawTicks: true
}
},
y: {
beginAtZero: true
}
}
}
};
return config;
It gives me this chart: