I'm using Ng2-charts for drawing pie chart in the angular App.
If I assign this.pieChartData
values inside constructor
or ngOnInIt
, pie chart is rendering properly without any issue.
ngOnInit () { this.pieChartData = [10,20]; } // works fine
But if i assign the values inside the .subscribe
method, pie chart color is not rendering.
this.service.getJiraOpenIssues('22407')
.subscribe((response)=>{
this.pieChartData = [10,20];
});
Please tell me what I'm doing wrong here.