0👍
✅
Try this Split Json into 2 different arrays and use that data in chart.js
var arr = [{"Date":"2016-05-09","Sessions":"295"},{"Date":"2016-05-10","Sessions":"308"},{"Date":"2016-05-11","Sessions":"288"},{"Date":"2016-05-12","Sessions":"253"},{"Date":"2016-05-13","Sessions":"261"},{"Date":"2016-05-14","Sessions":"222"},{"Date":"2016-05-15","Sessions":"298"},{"Date":"2016-05-16","Sessions":"363"},{"Date":"2016-05-17","Sessions":"328"},{"Date":"2016-05-18","Sessions":"356"},{"Date":"2016-05-19","Sessions":"321"},{"Date":"2016-05-20","Sessions":"287"},{"Date":"2016-05-21","Sessions":"371"},{"Date":"2016-05-22","Sessions":"328"},{"Date":"2016-05-23","Sessions":"310"},{"Date":"2016-05-24","Sessions":"515"},{"Date":"2016-05-25","Sessions":"465"},{"Date":"2016-05-26","Sessions":"354"},{"Date":"2016-05-27","Sessions":"330"},{"Date":"2016-05-28","Sessions":"298"},{"Date":"2016-05-29","Sessions":"295"},{"Date":"2016-05-30","Sessions":"365"},{"Date":"2016-05-31","Sessions":"425"},{"Date":"2016-06-01","Sessions":"449"},{"Date":"2016-06-02","Sessions":"326"},{"Date":"2016-06-03","Sessions":"318"},{"Date":"2016-06-04","Sessions":"279"},{"Date":"2016-06-05","Sessions":"253"},{"Date":"2016-06-06","Sessions":"369"},{"Date":"2016-06-07","Sessions":"331"}]
var dateArr = [];
var sessionArr = [];
for (i=0;i<arr.length;i++) {
for (n in arr[i]) {
if (n == 'Date') {
dateArr.push(arr[i][n]);
} else {
sessionArr.push(arr[i][n]);
}
}
}
console.log(dateArr);
console.log(sessionArr);
Source:stackexchange.com