Skip to content

Commit

Permalink
feat(label): Update Labels onChange (#488)
Browse files Browse the repository at this point in the history
I guess the if shouldn't be in the change data loop. This worked for me.
  • Loading branch information
alfakappa authored and valorkin committed Oct 27, 2016
1 parent c3dad9e commit 527d9a3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions components/charts/charts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,9 @@ export class BaseChartDirective implements OnDestroy, OnChanges, OnInit {
public ngOnChanges(changes:SimpleChanges):any {
if (this.initFlag) {
// Check if the changes are in the data or datasets
if (changes.hasOwnProperty('data') || changes.hasOwnProperty('datasets')) {
if (changes.hasOwnProperty('data') || changes.hasOwnProperty('datasets') || changes.hasOwnProperty('labels')) {
this.chart.data.datasets = this.getDatasets();
if (changes.hasOwnProperty('labels')) {
this.chart.data.labels = this.labels;
}
this.chart.data.labels = this.labels;
this.chart.update();
} else {
this.refresh();
Expand Down

0 comments on commit 527d9a3

Please sign in to comment.