Open y-takey opened 11 months ago
Is this issue should fix this type error ?
when I use options: ChartOptions<'bar'>
then I can not use plugin, I get error:
Type '{ id: string; beforeInit: (chart: Chart<keyof ChartTypeRegistry, (number | [number, number] | Point | BubbleDataPoint)[], unknown>, args: EmptyObject, options: PluginOptions) => void; beforeUpdate: (chart: Chart<...>, args: { ...; }, options: PluginOptions) => boolean | void; afterUpdate: (chart: Chart<...>, args: {...' is not assignable to type 'Plugin<"bar", AnyObject>[]'
I have to cast plugin type:
public plugins: Plugin<'bar', AnyObject>[] = [
ChartjsPluginStacked100 as Plugin<'bar', AnyObject>,
];
then it works.
chartjs-plugin-stacked100@1.5.2",
chart.js@4.4.1
Hi @frenzymind , I apologize for the delayed response. Thank you for the report :)
Actually, I don't have a deep understanding of type definitions. If possible, could you make the necessary changes to the plugin's type definition and submit a pull request? That would be very helpful.
see https://github.com/chartjs/chartjs-plugin-datalabels/issues/388#issuecomment-1647381453