Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ng2-google-charts

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng2-google-charts

Angular2 Google Charts module

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.2K
increased by4.52%
Maintainers
1
Weekly downloads
 
Created
Source

ng2-google-charts

Google Charts module for Angular 2

Please see this page for a live demo.

NPM Version Downloads

Install

npm i --save ng2-google-charts

Usage

Add the following inside the <head> element in your index.html:

<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>

Import the Ng2GoogleChartsModule in your app.module.ts:

import { Ng2GoogleChartsModule } from 'ng2-google-charts';

@NgModule({
  ...
  imports: [
    ...
    Ng2GoogleChartsModule,
  ],
})
export class AppModule { }

In your templates, use the google-chart component like this:

<google-chart [(ngModel)]="pieChartOptions"></google-chart>

and in the corresponding .ts file:

pieChartOptions =  {
  chartType: 'PieChart',
  dataTable: [
    ['Task', 'Hours per Day'],
    ['Work',     11],
    ['Eat',      2],
    ['Commute',  2],
    ['Watch TV', 2],
    ['Sleep',    7]
  ],
  options: {'title': 'Tasks'},
};

Please see this page for a demo with more examples.

License

MIT

Keywords

FAQs

Package last updated on 03 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc