echarts通过ajax获取数据,但是,显示不了?
success:function(data){varobj=eval('('+data+')');vardatas="";for(vari=0;i<obj.length;...
success:function(data){
var obj = eval('(' + data + ')');
var datas="";
for(var i=0;i<obj.length;i++){
for(var key in obj[i]){
//console.log("key:"+key+",value:"+obj[i][key]);
datas+=obj[i][key]+",";
}
}
var d=datas.substring(0,datas.lastIndexOf(","));
console.log(d);
series : [
{
name:'预购',
type:'line',
smooth:true,
itemStyle: {normal: {areaStyle: {type: 'default'}}},
data:[d]
}
] 展开
var obj = eval('(' + data + ')');
var datas="";
for(var i=0;i<obj.length;i++){
for(var key in obj[i]){
//console.log("key:"+key+",value:"+obj[i][key]);
datas+=obj[i][key]+",";
}
}
var d=datas.substring(0,datas.lastIndexOf(","));
console.log(d);
series : [
{
name:'预购',
type:'line',
smooth:true,
itemStyle: {normal: {areaStyle: {type: 'default'}}},
data:[d]
}
] 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询