var item = [];
var arr = [];
var res = '';
for (let key in obj) {
a = obj[key];
arr = a.split(',');
res = [arr[0],+arr[1]];
item[key] = res;
}
На выходе
Array(9) [ (2) […], (2) […], (2) […], (2) […], (2) […], (2) […], (2) […], (2) […], (2) […] ]
0: Array [ "2021-10-04", 45 ]
1: Array [ "2021-10-06", 45.5 ]
2: Array [ "2021-10-20", 40 ]
3: Array [ "2021-10-31", 45 ]
4: Array [ "2021-11-01", 45.5 ]
5: Array [ "2021-11-03", 40 ]
6: Array [ "2021-11-10", 45.5 ]
7: Array [ "2021-11-16", 50 ]
8: Array [ "2021-11-26", 45 ]
length: 9
График ругается,если подставляю
var data = google.visualization.arrayToDataTable([
item
]);
Data column(s) for axis #0 cannot be of type string×