1👍
legend
must be placed inside options.plugins
, same as datalabels
.
const options = {
plugins: {
datalabels: {
...
},
legend: {
position: 'left'
}
}
};
For further information, please consult the Chart.js documentation here.
- Chartjs-Is it possible to have a canvas next to another canvas without space on the bottom?
- Chartjs-React & Chartjs: How can I best destroy my chart when re-rendering?
Source:stackexchange.com