0
我的JSON數據是這樣的:使用xy座標將Json或Mongodata解析爲viz.js數據集?
[ {
"age": 21,
"eyeColor": "blue",
"name": "Dejesus Thornton",
"gender": "male",
"registered": "2015-06-10"
},
{
"age": 21,
"eyeColor": "blue",
"name": "Dejesus Thornton",
"gender": "male",
"registered": "2015-06-11"
},
{
"age": 21,
"eyeColor": "blue",
"name": "Dejesus Thornton",
"gender": "male",
"registered": "2015-06-12"
},
...
]
我解析它變成我的流星蒙戈集合是這樣的(在收集每一個項目都是一個對象):
{
"age": 21,
"eyeColor": "blue",
"name": "Dejesus Thornton",
"gender": "male",
"registered": "2015-06-11"
}
我試圖解析這種數據爲viz.js它接受這樣的數據:
var items = [
{x: '2014-06-13', y: 30, group: 0},
{x: '2014-06-14', y: 10, group: 0},
{x: '2014-06-15', y: 15, group: 1},
{x: '2014-06-16', y: 30, group: 1},
{x: '2014-06-17', y: 10, group: 1},
{x: '2014-06-18', y: 15, group: 1}
];
我想指望有多少人在同一天登記或有相同的眼睛顏色(相同的東西)。