score:0

Accepted answer

we hit a similar problem and needed to make sure we globally register the annotation plugin in our project root.

without this, the annotation silently fails just as you are describing:

import { chart } from 'chart.js';
import annotationplugin from 'chartjs-plugin-annotation';
chart.register(annotationplugin);

also, just referencing the annotation in your options object is enough. no need for the plugins argument to the chart component itself here:

<chart    
  type="line"
 :data="data"
 :options="options"
 :plugins="annotationplugin"
/>

source: https://www.chartjs.org/chartjs-plugin-annotation/latest/guide/integration.html#bundlers-webpack-rollup-etc


Related Query

More Query from same tag