Skip to content

Commit

Permalink
fix(labels): Update chart labels (#456)
Browse files Browse the repository at this point in the history
The update method introduced in #410 and merged in #414 removed the ability of updating chart labels dynamically.

Closes #420 #445
  • Loading branch information
Puigcerber authored and valorkin committed Oct 10, 2016
1 parent 1406c57 commit 7175c1e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/charts/charts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ export class BaseChartDirective implements OnDestroy, OnChanges, OnInit {
// Check if the changes are in the data or datasets
if (changes.hasOwnProperty('data') || changes.hasOwnProperty('datasets')) {
this.chart.data.datasets = this.getDatasets();
if (changes.hasOwnProperty('labels')) {
this.chart.data.labels = this.labels;
}
this.chart.update();
} else {
this.refresh();
Expand Down

5 comments on commit 7175c1e

@dcantu476
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When will you put this on master? I have this project via npm and I manually modified the code using your changes above and it fixed my issue. Awesome project btw!

@valorkin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that I already published it

@dcantu476
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last update to master was 23 days ago from what I can see. The code above is not part of the master branch

@valorkin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default branch is development

@dcantu476
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, Thanks. I did not realize. I'll look further into why I am not getting the latest code. Maybe a caching issue. Thanks again for the fix and the project!

Please sign in to comment.