Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call Chart.js methods #7

Closed
d668 opened this issue Dec 10, 2016 · 5 comments
Closed

call Chart.js methods #7

d668 opened this issue Dec 10, 2016 · 5 comments

Comments

@d668
Copy link

d668 commented Dec 10, 2016

In the doc you are saying:

Chart instance. You can call Chart.js methods via this member.

What this supposed to mean? There is no chartComponent available

@emn178
Copy link
Owner

emn178 commented Dec 10, 2016

Please refer to this.
See section Parent interacts with child via a local variable and Parent calls a ViewChild.

@mgween
Copy link

mgween commented Apr 17, 2017

Could you please provide an example? I still don't understand how to apply prototype methods.

@colmben
Copy link

colmben commented May 11, 2018

From one of the other issues:

You should use ChartComponent


import { ChartComponent } from 'angular2-chartjs';

//...

@ViewChild(ChartComponent) chart: ChartComponent; 

//...

this.chart.chart.update();

@maikelthedev
Copy link

But this doesn't work when you have two charts on the same page.

@apostnov
Copy link

apostnov commented Aug 3, 2018

@maikeldotuk Sure, in case of multiple components @ViewChildren() should be used. See https://angular.io/api/core/ViewChildren

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants