1👍
Ok, found it…
I forgot to read this part: https://www.chartjs.org/docs/latest/developers/plugins.html#typescript-typings
If you want your plugin to be statically typed, you must provide a .d.ts TypeScript declaration file. Chart.js provides a way to augment built-in types with user-defined ones, by using the concept of "declaration merging".
When adding a plugin, PluginOptionsByType must contain the declarations for the plugin.
Added the d.ts file:
import {ChartType, Plugin} from 'chart.js';
declare module 'chart.js' {
interface PluginOptionsByType<TType extends ChartType = ChartType> {
tstPlugin?: {
color?: string
}
}
}
And problem solved… I was about to delete the post but I leave it because maybe it will be useful to someone else who is doing their first steps with this like me
- Chartjs-Multiple instances of vue-chartjs
- Chartjs-How to format Chart.js dates in the axes and tooltip
Source:stackexchange.com