Data Browser - Viewing Site  Sector 23 Code Bank Logged in as:  Guest  




           


Add Google Chart to angular 11
package.json:
"angular-google-charts": "2.2.2",

app.module.ts:
import { GoogleChartsModule } from 'angular-google-charts';
imports: [
GoogleChartsModule,

component .ts:
import { ChartType, Row } from "angular-google-charts";
pieChartType = ChartType.PieChart;

component .html:
<google-chart [type]="pieChartType" [data]="completionChart"
[options]="options"></google-chart>
- set options and data as needed

-"pieChartType" is required to avoid error: Type '"PieChart"' is not assignable to type 'ChartType'

Created By: amos 4/4/2022 2:46:17 PM
Updated: 4/4/2022 2:47:05 PM