0
App developed in Ionic.
cli packages: (/usr/lib/node_modules)
@ionic/cli-utils : 1.19.1
ionic (Ionic CLI) : 3.19.1
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
@ionic/app-scripts : 3.1.4
Cordova Platforms : android 6.3.0 browser 5.0.1 ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
Node : v8.9.3
npm : 5.6.0
OS : Linux 4.10
Chart.js is not displayed in android emulator. ionic cordova run android --emulator
.
Note: Android 6 (api 23) works, Android 7 (api 25) and 8 (api 26) does not works.
But in the web view (ionic cordova run browser
) and iPhone (Ionic View App) it displays perfectly.
html template
<canvas #elChart></canvas>
scss
canvas {
width: 100% !important;
}
Component.ts (I tried setar Responsive and maintainAspectRatio as true or false)
ngOnInit() {
this.chart = new Chart(this.elChart.nativeElement, {
type: this.typeChart,
data: {
datasets: [{
data: this.dataChart,
backgroundColor: this.colorsChart,
borderWidth: 0
}],
labels: this.labelsChart
},
options: {
responsive: false,
maintainAspectRatio: false,
legend: {
display: false,
},
}
});
}