Chartjs-How update reload chart.js

0👍

The datasets are an array of of datasets. So you can just target data on datasets. You need to select the correct one first. Asuming you only have 1 dataset that can be done like so:

 function dane() { 
  myChart.config.data.labels = xdata1;
  myChart.config.data.datasets[0].data = ydata1;     
  
  myChart.update();
}

Leave a comment