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 the android emulator. ionic cordova run android --emulator
.
Note:Android6(api23)works,Android7(api25)and8(api26)no itworks.
Butinwebview(ioniccordovarunbrowser
)andiPhone(IonicViewApp)itisdisplayedperfectly.
html template
<canvas #elChart></canvas>
scss
canvas {
width: 100% !important;
}
component.ts (I tried to set responsive and maintainAspectRatio to 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,
},
}
});
}