我的json数据:
{
"d":[
{
"__type":"DashBoardControl.Info.DashBoardSettingInfo",
"VisitTime":"183",
"Browser":"Firefox"
},
{
"__type":"DashBoardControl.Info.DashBoardSettingInfo",
"VisitTime":"28",
"Browser":"Chrome"
},
{
"__type":"DashBoardControl.Info.DashBoardSettingInfo",
"VisitTime":"2",
"Browser":"IE"
},
{
"__type":"DashBoardControl.Info.DashBoardSettingInfo",
"VisitTime":"1",
"Browser":"Opera"
}
]
}
我尝试像这样在二维数组中制作这些数据。但我失败了。
var BrowserWiseVisit = [];
if (msg.d.length > 0) {
var arrVisit = [];
$.each(msg.d, function (index, item) {
arrVisit = [];
arrVisit.push(item.Browser);
arrVisit.push(item.VisitTime);
BrowserWiseVisit.push(arrVisit);
});
}
我想要这种格式的数据
[['Firefox', 183], ['Chrome', 28], ['IE', 2], ['Opera', 1]];
使用http://www.jqplot.com/这个插件。谢谢。