chartjs version: 3.6.0
chartjs-plugin-annotation version: 1.0.2
The plugin is registered like this:
import { Chart } from 'chart.js';
import annotationPlugin from 'chartjs-plugin-annotation';
Chart.register(annotationPlugin);
And I'm using the plugin as a constant that I add to the graph configuration:
plugins = {
autocolors: false,
annotation: {
annotations: {
box1: {
type: 'box',
yMin: 2,
yMax: 4,
backgroundColor: 'rgba(221, 29, 33, 0.3)',
borderColor: 'rgba(0,0,0,0)',
},
box2: {
type: 'box',
yMin: 0,
yMax: 2,
backgroundColor: 'rgba(251, 206, 7, 0.3)',
borderColor: 'rgba(0,0,0,0)',
},
box3: {
type: 'box',
yMin: -2,
yMax: 0,
backgroundColor: 'rgba(92, 171, 42, 0.3)',
borderColor: 'rgba(0,0,0,0)',
},
box4: {
type: 'box',
yMin: -4,
yMax: -2,
backgroundColor: 'rgba(166, 166, 166, 0.3)',
borderColor: 'rgba(0,0,0,0)',
},
},
},
};
I'm rendering the graph as a base64 string so that I can turn it into a static image. The data is plotted but the boxes are not. It was working two weeks ago and now it isn't.