Chartjs-Chart.js data wont update

0👍

Probally you’re forgetting two things.

First: You need select the chart, something like this:
var ctx = document.getElementById("myChart").getContext('2d');

for use:

var myChart = new Chart(ctx, {
type: 'bar',
data: {//your code to build chart}

Second: myChart.update();

chartjs.org/docs/latest/
chartjs.org/docs/latest/developers/updates.html

Leave a comment