Chartjs-How to adjust Chart.js height according to datasets size. Ionic 3

0👍

The problem was on the filter. I was using a modal that was sending values to another new view this.navCtrl.push(IndicadoresPage, {consulta: consulta});.
I changed to this.viewCtrl.dismiss(consulta) and caught the data with onDidDismiss().

Then I compared the size of the data return and set chart.canvas.parentNode.style.height = 'XXXpx'; according to the data size.

Leave a comment