日期:2014-05-16 浏览次数:20441 次
var json = [{"day":"1969-12-31","sum":10},{"day":"1969-12-30","sum":20},{"day":"1969-12-29","sum":30},{"day":"1969-12-28","sum":15},{"day":"1969-12-27","sum":26},{"day":"1969-12-26","sum":33},{"day":"1969-12-25","sum":18}];
var chartData = [];
for(var i=json.length-1; i>=0 ; i--)
chartData.push({
country: json[i].day.replace(/^\d\d\d\d-/,""),
visits: json[i].sum,
color: "#FF0F00"
});
var json = [{"day":"1969-12-31","sum":10},{"day":"1969-12-30","sum":20},{"day":"1969-12-29","sum":30},{"day":"1969-12-28","sum":15},{"day":"1969-12-27","sum":26},{"day":"1969-12-26","sum":33},{"day":"1969-12-25","sum":18}];
var chartData = [];
var obj={};
$(json.reverse()).each(function(i,e){
obj.country=e.day.replace(/^\d\d\d\d-/,"");
obj.visits=e.sum;
obj.color="#FF0F00";
chartData.push(obj);
});