angular2-google-chart
Advanced tools
Comparing version 2.2.4 to 2.2.5
@@ -62,3 +62,3 @@ System.register(["@angular/core"], function (exports_1, context_1) { | ||
core_1.Directive({ | ||
selector: '[GoogleChart]', | ||
selector: '[GoogleChart]' | ||
}), | ||
@@ -65,0 +65,0 @@ __metadata("design:paramtypes", [core_1.ElementRef]) |
import {Directive, ElementRef, Input, OnChanges} from '@angular/core'; | ||
declare var google: any; | ||
declare var googleLoaded: any; | ||
declare var googleChartsPackagesToLoad: any; | ||
declare let google: any; | ||
declare let googleLoaded: any; | ||
declare let googleChartsPackagesToLoad: any; | ||
@Directive({ | ||
selector: '[GoogleChart]', | ||
// properties: [ | ||
// 'chartType', | ||
// 'chartOptions', | ||
// 'chartData' | ||
// ] | ||
selector: '[GoogleChart]' | ||
}) | ||
export class GoogleChart implements OnChanges { | ||
public _element:any; | ||
@Input('chartType') public chartType:string; | ||
public _element: any; | ||
@Input('chartType') public chartType: string; | ||
@Input('chartOptions') public chartOptions: Object; | ||
@@ -24,21 +19,21 @@ @Input('chartData') public chartData: Object; | ||
ngOnChanges() { | ||
if(!googleLoaded) { | ||
if (!googleLoaded) { | ||
googleLoaded = true; | ||
google.charts.load('current', {'packages':['corechart', 'gauge']['orgchart']}); | ||
} | ||
setTimeout(() =>this.drawGraph(this.chartOptions,this.chartType,this.chartData,this._element),1000); | ||
google.charts.load('current', { 'packages': ['corechart', 'gauge']['orgchart'] }); | ||
} | ||
setTimeout(() => this.drawGraph(this.chartOptions, this.chartType, this.chartData, this._element), 1000); | ||
} | ||
drawGraph (chartOptions,chartType,chartData,ele) { | ||
google.charts.setOnLoadCallback(drawChart); | ||
function drawChart() { | ||
var wrapper; | ||
wrapper = new google.visualization.ChartWrapper({ | ||
chartType: chartType, | ||
dataTable:chartData , | ||
options:chartOptions || {} | ||
}); | ||
drawGraph(chartOptions, chartType, chartData, ele) { | ||
google.charts.setOnLoadCallback(drawChart); | ||
function drawChart() { | ||
var wrapper; | ||
wrapper = new google.visualization.ChartWrapper({ | ||
chartType: chartType, | ||
dataTable: chartData, | ||
options: chartOptions || {} | ||
}); | ||
wrapper.draw(ele); | ||
} | ||
} | ||
} | ||
} |
{ | ||
"name": "angular2-google-chart", | ||
"version": "2.2.4", | ||
"version": "2.2.5", | ||
"description": "google chart directive for angular2", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
726260
674