angular2-google-chart
angular2-google-chart copied to clipboard
Refresh on data change
Chart was not refreshing wen data changes. I handled ngOnChanges event and it worked. ngOnChanges(){ if(!googleLoaded) { googleLoaded = true; google.charts.load('current', {'packages':['corechart', 'gauge']}); } setTimeout(() =>this.drawGraph(this.chartOptions,this.chartType,this.chartData,this._element),1000); }
+1
I just added
ngOnChanges(changes) { if (googleLoaded) { this.drawGraph(this.chartOptions,this.chartType,this.chartData,this._element); } }
in angular2-google/directives/angular2-google-chart.directive.ts and imorted OnChanges
. Works fine too. Can someone include this in the code?
I will do soon. Thanks
Hi I have updated the above request