-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Object literal may only specify known properties, and 'annotation' does not exist in specified type #886
Comments
Thanks @stockiNail for your quick reply. My quick & dirty workaround :
This way everything works... |
good! Anyway I want to understand where we should fix it (chartjs or plugins) because that's annoying me.... |
By the way, I'm sorry to ask here if it's not the right place, but I guess it's related: |
@rfrancois already fixed, See PR #885. We are evaluating how to fix the version 3.0.0 link. |
Great thanks |
Hello guys I have the same error, even if I use only the Annotation plugin and totally disable the zoom plugin. I'm using Angular 15 and "ng2-charts": "^4.1.1" with these other libraries
I tried the proposed workaround but it doesn't work on my configuration, the error remains. Some idea about that? |
@wizard982 I did a test importing annotation, zoom and datalabels, using the workaround suggested by @rfrancois and it works (defining the plugins options separately). I have a sample project with angular (not ng-charts). |
Created issue in Chart.js repo: chartjs/Chart.js#11288 |
What happens if the same type changes are applied to the zoom plugin? The PR in that repository is still open. |
I have tested changing the types of zoom plugin (setting the default type) in |
Tried the same thing as @stockiNail can confirm, it does not solve the issue. As an additional (but maybe trivial) information: if I import the annotation plugins first, the zoom plugin type is missing, but if I import the zoom plugin first, the annotation plugin type is missing. Will keep an eye on chartjs/Chart.js#11288 but I'm not sure that it will solve the problem. |
@wizard982 @csisy @rfrancois See comment chartjs/Chart.js#11288 (comment) |
@wizard982 @csisy @rfrancois See PR in Chart,js chartjs/Chart.js#11309. If you are blocked, as workaround, waiting for PR approval and merging in Chart,js, you could change the following file in your project: node_modules/chart.js/dist/types.d.ts adding .......
/**
* Explicitly re-exporting to resolve the ambiguity.
*/
export { PluginOptionsByType, BarController, BubbleController, DoughnutController,
...... |
PR chartjs/Chart.js#11309 in Chart,js has been merged. This bug will be fixed by next Chart.js version. |
I tried version 3.0.0 and I have a new error :
Object literal may only specify known properties, and 'annotation' does not exist in type '_DeepPartialObject<PluginOptionsByType<keyof ChartTypeRegistry, keyof ChartTypeRegistry>>'.
With this code :
My versions :
"chart.js": "^4.3.0",
"chartjs-adapter-moment": "^1.0.1",
"chartjs-plugin-annotation": "^3.0.0",
"chartjs-plugin-zoom": "^2.0.1",
If I remove zoom plugin, it works though. But I would like both plugins.
Any suggestion ?
Originally posted by @rfrancois in #877 (comment)
The text was updated successfully, but these errors were encountered: