1👍
Here’s how your options object should look like:
{
...
annotation: {
annotations: [
{<your annotation object code here>}
],
},
...
}
Next, you’ve correctly identified that you should use the addPluing()
method, just make sure to use it like so
// in imports
import SomePlugin from "..."
// in mounted
this.addPlugin(SomePlugin);
- Chartjs-Chart.js canvas resize of pie / doughnut chart
- Chartjs-Chartjs Stacked bar have a stack id per x value
0👍
https://stackoverflow.com/a/65486537/7165219
import chartjsPluginAnnotation from "chartjs-plugin-annotation";
And:
mounted() {
Chart.plugins.register(chartjsPluginAnnotation);
this.addPlugin(chartjsPluginAnnotation);
this.renderChart(this.chartData, this.options);
}
- Chartjs-Why is the data from my API not displaying on my chart.js chart in React?
- Chartjs-How to show label for second y-axis in charts.js?
Source:stackexchange.com