Open throwaway34059 opened 11 months ago
@throwaway34059 thank you for your feedback. I have some doubts that the plugin could work with the same configuration in The previous version of chartjs. The annotation plugin must be registered (see doc) and cannot be used as an inline plugin (as you reported in the exception).
In fact, the exception about the missing install should occur because the plugin is defined as inline plugin (even if it seems not reported in the code but only in the exception)
plugins={[ChartAnnotation]}
instead of registered it (https://www.chartjs.org/chartjs-plugin-annotation/latest/guide/integration.html#bundlers-webpack-rollup-etc):
import { Chart } from 'chart.js';
import annotationPlugin from 'chartjs-plugin-annotation';
Chart.register(annotationPlugin);
Furthermore that the plugin is not working on doughnut/pie charts. The trick is to define the axes as well but if this check will be apply in chartjs and the axes will not maintain in those chart types, the plugin will not work.
If you can provide an example to reproduce the issue could be great!
I'll check and see. I don't know why it broke in such a minor version change.
I am not sure if this is an issue with this plugin or https://github.com/reactchartjs/react-chartjs-2. Or a combination of both. But the 4.4.1 update to chart js broke me. Rolling back to 4.4.0 makes everything happy again. Looks like some types are missing. Any help would be appreciated.
Package versions "chart.js": "^4.4.1", "chartjs-plugin-annotation": "^3.0.1", "react-chartjs-2": "^5.2.0",
Example Code: