Closed luccaclemente closed 6 years ago
e.defaults.global.plugins
doesn't exist, it should be Chart.defaults.global.plugins
My chart code:
`var ctx = document.getElementById('chart-1-container').getContext('2d'); var chart = new Chart(ctx, { // The type of chart we want to create type: 'line',
// The data for our dataset
data: {
labels: labels1,
datasets: [{
label: "Total de acessos",
borderColor: 'rgb(255, 99, 132)',
data: data1,
}]
},
// Configuration options go here
options: {
plugins: {
datalabels: {
backgroundColor: function(context) {
return context.dataset.backgroundColor;
},
borderRadius: 4,
color: 'white',
font: {
weight: 'bold'
},
}
},
scales: {
yAxes: [{
stacked: true
}]
}
}
});`
The files I imported:
`
` The chart is displaying correctly, but there is no label of the data on it.... but there is no label of the data on it.
This is the deferred plugin, try the datalabels plugin instead!
I'm getting the message "e.defaults.global.plugins is undefined" when trying to use the plugin on my charts.
Any help?