Found a bunch of old posts but couldn't find anything on the newer versions. I'm using Chartjs 3.7.1 and chartjs-plugin-annotation 1.4.0
I can add a new annotation via:
myChart.options.plugins.annotation.annotations['newAnnotation'] = {
type: 'line',
xMin: 0,
xMax: 11,
yMin: 200000,
yMax: 200000,
borderColor: 'rgb(255, 99, 132)',
borderWidth: 2
};
myChart.update();
but how do I access the the existing annotation dynamically in order to change the value afterwards?
Trying something like this didn't work:
myChart.options.plugins.annotation.annotations[0].value = 200000;