Chartjs-Updating chart.js not working after recieved new data from database with ajax

0👍

✅

The problem was that I was passing an object and it expected an array. My var Data is a single JSON object containing multiple JSON objects. After I applied valueTemp = JSON.parse(Data.temperature); , it returns an array of temperature values, exactly what I needed.

0👍

Have you tried accessing the update function as a DOM object?

window.myChartTemp.update(); or
document.myChartTemp.update();

Leave a comment