var nullArr = [null, 0, 0, 0, 0];
var chartData = [];
for (var i = 0; i < resData.length; i++) {
var ownArr = [];
var grArr = [];
grArr.push(resData[i].Title, resData[i].GrValue1, resData[i].GrValue2, 0, 0);
ownArr.push(resData[i].Title, 0, 0,
resData[i].OwnValue1,resData[i].OwnValue2);
chartData.push(grArr, ownArr, nullArr);
}
}
var data = google.visualization.arrayToDataTable([
['Year', 'A', 'B', 'A', 'B'],
['2012', 900, 390, null, null],
['2012', null, null, 100, 500],
['', null, null, null, null],
['2013', 1170, 440, null, null],
['2013', null, null, 200, 210],
['', null, null, null, null],
['2014', 1170, 440, null, null],
['2014', null, null, 200, 210],
]);
如何将数据推送到arrayToTable
?我的阵列不正确。我的数据会发生什么。
我想画这样的图表:tpcg.io/NjLnTv