-
Notifications
You must be signed in to change notification settings - Fork 57
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
Angular 12.1.2 | Typescript error while importing chartjs-plugin-trendline #63
Comments
I don't have any experience with Angular 12. I hope someone see this and can help. |
I have released a new version. Please try it and see if it solves your problem. @anubhav-aggarwal |
Hello, I've tried to install the package on a node.js environment and the same issue still seems to persist. I'm getting the same error where it seems to be missing a .d.ts file. I simply ran I'm looking through your github repo and I can't find a .d.ts file anywhere I can manually add. Could you maybe look into adding a .d.ts file? It seems like that's the only issue but maybe you know more about this issue than I do and I'm simply doing something wrong so let me know, thanks in advance! |
I opened a pr for DefinitelyTyped to have types implemented for this plugin. |
It's now published and you can install |
Thanks @Ferotiq |
Very nice... But I can not seem to get to use it. Is there a documentation paragraph? )) I ran Edit: or you can restart vs-code and then it works ;-P ))) |
I followed the instructions to install the plugin in my Angular 12.1.2 application using -
npm i chartjs-plugin-trendline
On importing chartTrendLine, using this command -
import {Chart, ChartConfiguration, ChartDataset, registerables} from 'chart.js';
import chartTrendline from "chartjs-plugin-trendline";
I get the following error -
"TS7016: Could not find a declaration file for module 'chartjs-plugin-trendline'. '/Users/anubhav.aggarwal/Documents/polaris-repo/polaris-web-app/node_modules/chartjs-plugin-trendline/src/chartjs-plugin-trendline.js' implicitly has an 'any' type. Try
npm i --save-dev @types/chartjs-plugin-trendline
if it exists or add a new declaration (.d.ts) file containingdeclare module 'chartjs-plugin-trendline';
"Hence, I'm not able to register the plugin using following command -
Chart.register(chartTrendline);
Kindly help.
The text was updated successfully, but these errors were encountered: