Hello to all, welcome again on therichpost.com. In this post, I will tell you, Angular 9/10 Google Charts Working Example.
Post Working:
In this post, I am showing google pie chart in Angular 10.
Angular 9/10 google chart working example
Here is the working code snippet and please follow carefully:
1. Very first, here are common basics steps to add angular 10 application on your machine:
npm install -g @angular/cli
ng new angularcharts // Set Angular10 Application on your pc
cd angularcharts // Go inside project folder
ng serve // Run project
http://localhost:4200/ //Check working Local server
Â
2. Now run below command into your terminal to include google chart package into your angular 10 application:
npm install angular-google-charts
Â
3. Now add below code into your app.module.ts file:
Hello to all. Welcome to therichpost.com. Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know WordPress, Core php, Angularjs, Angular 8, Angular 9, Angular 10, Angular 11, Angular12, Angular 13, Angular 14, Angular 15, , Angular 16, Bootstrap 5, Nodejs, Laravel, Codeigniter, Shopify, Squarespace, jQuery, Google Map Api, Vuejs, Reactjs, Big commerce etc.
For me, I was getting error : Type ‘string’ is not assignable to type ‘ChartType’, I just googled it and following is the solution:
Need to following additional import in : import { ChartType, Row } from “angular-google-charts”;
myType = ChartType.PieChart; // Angular CLI: 12.0.4
10 comments
Man this is not working
Oh never mind, it is working now!
Thanks
For me, I was getting error : Type ‘string’ is not assignable to type ‘ChartType’, I just googled it and following is the solution:
Need to following additional import in : import { ChartType, Row } from “angular-google-charts”;
myType = ChartType.PieChart; // Angular CLI: 12.0.4
Great and thanks.
Saved my life Chandu, thank you! Well, saved the rest of my work day at least 🙂
Nice. It works.
Thanks
Gracias por el aporte.
Thanks