var datas = [{ "_id" : { "$oid" : "4feeaa97cb675ea1a62cf64a"} , "Amount" : 35.0 , "Category_ID" : "Vegetables"}, { "_id" : { "$oid" : "4feeaaafcb675ea1a62cf64b"} , "Amount" : 55.0 , "Category_ID" : "Vegetables"}]; // these data are from database...
我想将其分配为,
var obj = {"row": datas};
但是当我使用like时它不起作用,
var data = new google.visualization.DataTable();
data.addColumn('string','Category_ID');
data.addColumn('number','Amount');
data.addRows([
[obj.row[0].Category_ID, obj.row[0].Amount],
[obj.row[1].Category_ID, obj.row[1].Amount],
[obj.row[2].Category_ID, obj.row[2].Amount]
]);