3👍
✅
For a start next time might be a good idea to read the documentation and the migration guide.
Few things that are at least wrong:
- Link name has changed to lower case so
2.9.4/Chart.js
->3.5.0/chart.js
- Scales have changed from 2 arrays to objects for each scale:
options: {
scales: {
x: {
// config for default x scale
},
x2: {
// config for second x scale
},
y: {
// config for default y scale
},
}
}
title
andlegend
config have been moved to theplugins
section sooptions.title
->options.plugins.title
andoptions.legend
->options.plugins.legend
.
Alternativly you could also just use an older release of the datalabels plugin that has been written for V2
<script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-datalabels/1.0.0/chartjs-plugin-datalabels.js"></script>
Source:stackexchange.com