I'm currently developing an app using angular 2 and using ng2-charts in the project. The project runs in browser well after wrapped by cordova. However, all ng2-charts is not displayed once running it on iOS using cordova.
I was wondering is it because the incompatibility between ng2-chart and iOS or any other reason?
Thanks a lot. :)
For example, the pie-chart component doesn't work on iOS but it is well-displayed in browser. Here are my code for pie-chart.component.ts:
import { Component } from '@angular/core';
@Component({
selector: 'pie-chart',
templateUrl: './pie-chart.html'
})
export class PieChartComponent {
// Pie
public pieChartLabels:string[] = ['A', 'B', 'C'];
public pieChartData:number[] = [300, 200, 100];
public pieChartOptions:any = {
responsive: true
};
public pieChartType:string = 'pie';
// events
public chartClicked(e:any):void {
console.log(e);
}
public chartHovered(e:any):void {
console.log(e);
}
}
Code for pie-chart.html:
<div style="display: block">
<canvas baseChart height = "150"
[data]="pieChartData"
[labels]="pieChartLabels"
[options]="pieChartOptions"
[chartType]="pieChartType"
(chartHover)="chartHovered($event)"
(chartClick)="chartClicked($event)">
</canvas>
</div>