鉴于 myData 是 JSON var,如下所示:
({0:{qID:"3", id:"1", shortText:"Leisure", OpiCount:"0"},
1:{qID:"3", id:"2", shortText:"Business", OpiCount:"3"},
2:{qID:"3", id:"3", shortText:"University visit", OpiCount:"1"}, length:3})
转换为浮点数据数组:
var data = [];
myData.each(function(i,v) {
data[i] = { label: v.shortText, data: v.OpiCount } ;
})
上面的代码因为v.shortText
. 我该如何克服呢?