1👍
The plugin needs to have an unique id.
You could add an id (see following example):
const annotationLinePlugin = {
id: 'annotationLine',
....
}
Be also aware the afterDatasetsDraw hook has got a different signature (arguments).
https://www.chartjs.org/docs/latest/api/interfaces/Plugin.html#afterdatasetsdraw
- [Chartjs]-ChartJs – Round borders on a doughnut chart with multiple datasets
- [Chartjs]-Chart.js not showing correctly/install issues
Source:stackexchange.com