Skip to content

Commit

Permalink
Fixed #568
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici committed Nov 16, 2016
1 parent f518f53 commit 5fb44ff
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions components/chart/chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,22 @@ export class UIChart implements AfterViewInit, OnDestroy, DoCheck {
}

ngDoCheck() {
var changes = this.differ.diff(this.data.datasets);
if (changes && this.initialized) {
if(this.chart) {
this.chart.destroy();
if(this.data && this.data.datasets) {
let changed = false;
for(let i = 0; i < this.data.datasets.length; i++) {
if(this.differ.diff(this.data.datasets[i].data)) {
changed = true;
break;
}
}

this.initChart();
if(changed && this.initialized) {
if(this.chart) {
this.chart.destroy();
}

this.initChart();
}
}
}

Expand Down

0 comments on commit 5fb44ff

Please sign in to comment.