I am working on an Ionic project that utilizes charts with the assistance of a library called chart.js. When I input dummy data into the chart, it displays the colors properly. Below is the code snippet for reference.
home.ts
public donutChartData: String[] = ["1100","1200","1300"];
public donutChartLabels: String[] = ["I","Me","Myself"];
public donutChartType: string = "doughnut"
home.html
<div style="display: block;">
<canvas baseChart [data]='donutChartData' height="350" [labels]='donutChartLabels' [chartType]='donutChartType'>
</canvas>
However, when I attempt to use customized data retrieved from Odoo server, the chart only displays in white color. Here is the data fetched from the API console.
-------donutChartData------800,900,1000,1200,1500
-------donutChartLabels------01-Aug-2017,02-Aug-2017,03-Aug-2017,04-Aug-2017,05-Aug-2017
The following code segment showcases how custom chart data is handled.
home.ts
public donutChartData: String[] = [];
public donutChartLabels: String[] = [];
public donutChartType: string = "doughnut"
private display(): void {
// Code implementation here
}
I have researched extensively but am unable to pinpoint the cause of this issue. Any assistance would be greatly appreciated. Thank you!