Add `chartjs-plugin-crosshair` after > v1.2.0 released with fixes
Closed this issue · 2 comments
DaveSkender commented
When upgrading to chart.js v3, the chartjs-plugin-crosshair
plugin did not work. Subsequent upgrades to the plugin by the author (v1.2.0) did not seem to resolve all issues related to using Angular build with Typescript.
I have not been able to get it to work and suspect it would require substantial effort to workaround issues. Wait for further plugin updates before trying to re-implement.
Error: src/app/chart/chart.service.ts:36:21 - error TS2322: Type '{ title: { font: { family: string; }; display: false; }; legend: { display: false; }; tooltip: { enabled: true; mode: "index"; intersect: false; }; crosshair: any; }' is not assignable to type '_DeepPartialObject<PluginOptionsByType<keyof ChartTypeRegistry>>'.
Object literal may only specify known properties, and 'crosshair' does not exist in type '_DeepPartialObject<PluginOptionsByType<keyof ChartTypeRegistry>>'.
options: {
plugins: {
...
crosshair: {...}
} }
node_modules/chart.js/types/index.esm.d.ts:2717:3
2717 plugins: PluginOptionsByType<TType>;
~~~~~~~
The expected type comes from property 'plugins' which is declared here on type '_DeepPartialObject<CoreChartOptions<keyof ChartTypeRegistry> & ElementChartOptions<keyof ChartTypeRegistry> & PluginChartOptions<...> & DatasetChartOptions<...> & ScaleChartOptions<...>>'
- Follow AbelHeinsbroek/chartjs-plugin-crosshair/#80 and others
DaveSkender commented
Not getting much support from the author of this plugin to fix anything. It does not work, even after overriding or adding missing typings.
DaveSkender commented
Whoa, a new release: https://github.com/AbelHeinsbroek/chartjs-plugin-crosshair/releases/tag/v2.0.0