score:1

Accepted answer

turns out that the issue wasn't chart.js at all; it was the asynchronous nature of data retrieval from firebase. i added a ref.on(....) and populate the arrays as mentioned in the answer by @john townsend, and it is rendering correctly now. thanks for your help!

score:1

you will want to do

this.weightchart.data.datasets[0].data.concat(weightarr);

this.weightchart.update();

and so on for the other datasets. if the concat isn't working, you'll want to loop through weightarr and push to the chart, then update.

for (var i = 0 ; i < weightarr.length; i++){
            this.weightchart.data.datasets[0].data.push(weightarr[i]);
}

this.weightchart.update();

hope this helps!


Related Query

More Query from same tag