[Chartjs]-Refresh chart.config.data

1👍

Fixed it.

var varbarlables = datas.map(a => a.labels);
var varbardataset= datas.map(a => a.dataval);
var labels = JSON.parse("[" + varbarlables + "]");

var mdata = JSON.parse("[" + varbardataset + "]");

myBarChart.config.data.labels = labels;
myBarChart.config.data.datasets[0].data = mdata;
myBarChart.update();

Leave a comment