0

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>
alexlu3211
  • 21
  • 1
  • 1
  • 3
  • You should provide some code and/or error output. Nobody will build a cordova app with this lib just to check... – n00dl3 Feb 06 '17 at 09:19
  • @n00dl3 Sure, I added in a sample code. But there is no error output at all for the project. – alexlu3211 Feb 06 '17 at 09:47

0 Answers0