I am using Chart.js for Ionic. The charts load fine on the root page but for each page after the root page in the navigation stack the charts show up blank.
Here's the .ts code:
ionViewDidLoad()
{
this.profile_donutCanvas = <HTMLCanvasElement> document.getElementById("profile_donutChart");
this.profile_donutCtx = this.profile_donutCanvas.getContext('2d');
this.profile_donutChart = new Chart(this.profile_donutCtx, {
type: 'doughnut',
data: {
labels: ['', ''],
datasets: [{
data: [100, 0],
backgroundColor: [
'rgba(182, 54, 235, 1)',
'rgba(255, 255, 255, 1)'
],
borderWidth: 0
}]
},
options: {
cutoutPercentage: 95,
legend:{
display:false
},
tooltips: {
enabled:false
}
}
});
}
and here's the .html code:
<canvas id="profile_donutChart" width="100" height="100" padding></canvas>
Does anybody know what could possibly cause this?
Thanks, Troy