echarts showloading 大神帮忙看看怎么设置出来?

Sunny369888 2018-01-15 10:02:45
各位大神帮忙看看,安装echarts api设置了,loading加载的图一直没有出现
下面就一个函数,获取合同 的数据,

function loadChartTrend() {
var chartTrend = echarts.init(document.getElementById('chartTrend'), echartsTheme);
chartTrend.showLoading();
$.ajax({
url : '/welcome/chartFlowTtend',
data : {
timeFlag : timeFlag,
startTime : startTime,
endTime : endTime
},
async : false,
type : 'GET',
dataType : 'json',
success : function(data) {
flowTime = data.flowTime;
flowUpRate = data.flowUpRate;
flowDnRate = data.flowDnRate;
flowAvgRate = data.flowAvgRate;
chartTrend.showLoading();
},
error : erryFunction

});
function erryFunction() {
alert("系统错误")
};

option_chartTrend = {

tooltip : {
trigger : 'axis',
axisPointer : { // 坐标轴指示器,坐标轴触发有效
type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},

legend : {
data : [ '上行速率(Mbps)', '下行速率(Mbps)', '均值速率(Mbps)' ],
top : '2%'
},
grid : {
left : '5%',
top : '35',
right : '5%',
bottom : '5%',
containLabel : true
},
toolbox : {
show : true,
right : '5%',
feature : {
mark : {
show : true
},
dataView : {
show : true,
readOnly : false
},
magicType : {
show : true,
type : [ 'line', 'bar', 'stack', 'tiled' ]
},
restore : {
show : true
},
saveAsImage : {
show : true
}
}
},
xAxis : {
boundaryGap : false,
maxInterval : 3600 * 24 * 1000,
data : flowTime
},

yAxis : {
type : 'value'
},
dataZoom : [ {
type : 'inside',
start : 0,
end : 100
}, {
showDataShadow : false,
start : 0,
end : 10
} ],
series : [ {
name : '上行速率(Mbps)',
type : 'line',
smooth : true,
itemStyle : {
normal : {
areaStyle : {
type : "default"
}
}
},
data : flowUpRate,
markPoint : {
data : [ {
type : 'max',
name : '最大值'
}, {
type : 'min',
name : '最小值'
} ]
},
markLine : {
data : [ {
type : 'average',
name : '平均值'
} ]
}
}, {
name : '下行速率(Mbps)',
type : 'line',
smooth : true,
itemStyle : {
normal : {
areaStyle : {
type : "default"
}
}
},
data : flowDnRate,
markPoint : {
data : [ {
type : 'max',
name : '最大值'
}, {
type : 'min',
name : '最小值'
} ]
},
markLine : {
data : [ {
type : 'average',
name : '平均值'
} ]
}
}, {
name : '均值速率(Mbps)',
type : 'line',
smooth : true,
itemStyle : {
normal : {
areaStyle : {
type : "default"
}
}
},
data : flowAvgRate,
markPoint : {
data : [ {
type : 'max',
name : '最大值'
}, {
type : 'min',
name : '最小值'
} ]
},
markLine : {
data : [ {
type : 'average',
name : '平均值'
} ]
}
} ]
};
chartTrend.setOption(option_chartTrend,true);
chartTrend.hideLoading();
}
...全文
741 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

87,907

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧