Is it possible to update any chart
from ng2-charts
dynamically? I know there are other libraries like angular2-highcharts
, but I would like to handle it using ng2-charts
. Main question is how can I redraw chart
, after button click? I can resize window and data will be updated, so it have to be any option to do it manually.
A good way is to get a grip on the chart itself in order to redraw it using the API :
export class MyClass {
@ViewChild( BaseChartDirective ) chart: BaseChartDirective;
private updateChart(){
this.chart.ngOnChanges({});
}
}