I'm not able to configure the plugin chartjs-plugin-annotation in Chartjs.
From the doc, I installed V 0.5.7 because I'm using Chart.js V 2.9.4.
Here my configuration:
register the plugin:
import Chart from "chart.js";
import annotationPlugin from "chartjs-plugin-annotation";
Chart.plugins.register(annotationPlugin);
//Chart.pluginService.register(annotationPlugin); //also tried this but doesn't work
and here the options configuration (simplified), i tried also to wrap "annototations" in "plugins" but it doesn't work :
scales: {
yAxes: [
{
scaleLabel: {
...
},
ticks: {
...
},
gridLines: {
...
},
},
],
xAxes: [
{
gridLines: {
...
},
ticks: {
...
},
},
],
},
maintainAspectRatio: false,
legend: {
...
labels: {
...
},
},
tooltips: {
...
},
annotation: {
annotations: [
{
type: "line",
mode: "horizontal",
scaleID: "yAxes",
value: 2.62,
borderColor: "white",
borderWidth: 4,
},
],
},
hover: {
...
},
What am I doing wrong?