hotlineLine();
setInterval(
function
() {
hotlineLine();
},5000);
function
hotlineLine(){
var
hotlineLine = echarts.init(document.getElementById(&
#39;hotlineLine_id'));
$.get(&
#39;${pageContext.request.getContextPath()}/m/hotline.do', function (res) {
var
option = {
tooltip: {
trigger: &
#39;axis'
},
color: [&
#39;#87CEFA', '#9AFF9A', '#C0FF3E','#DB7093'],
legend: {
data:[&
#39;呼入', '呼出', '应答', '用户放弃'],
textStyle:{
fontSize:10,
color:&
#39;#66ffff'
},
top:&
#39;5%'
},
grid: {
left: &
#39;7%',
right: &
#39;5%',
bottom: &
#39;10%',
top:&
#39;20%'
},
xAxis: {
type: &
#39;category',
data: [&
#39;08:00', '10:00', '12:00', '14:00', '16:00', '18:00', '20:00', '22:00', '24:00'],
axisLine:{
lineStyle:{
color:&
#39;#66ffff'
}
}
},
yAxis: {
type: &
#39;value',
name: &
#39;次数',
axisLabel: {
formatter: &
#39;{value}'
},
axisLine:{
lineStyle:{
color:&
#39;#66ffff'
}
},
splitLine:{
show:
true
,
lineStyle:{
color:&
#39;#66ffff'
}
}
},
series: [
{
name:&
#39;呼入',
type:&
#39;line',
data:res[3]
},
{
name:&
#39;呼出',
type:&
#39;line',
data:res[2]
},
{
name:&
#39;应答',
type:&
#39;line',
data:res[1]
},
{
name:&
#39;用户放弃',
type:&
#39;line',
data:res[0]
}
],
label: {
show:
true
,
position: &
#39;top',
textStyle: {
fontWeight:&
#39;bolder',
fontSize : &
#39;12',
fontFamily : &
#39;微软雅黑',
color:defaultColor
}
}
};
hotlineLine.setOption(option);
});
}
<p class=
"rightMain01-sub03 box-border"
>
<p class=
"box-title"
>话务指标趋势图</p>
<p class=
"rightMain01-sub03-data"
>
<p id=
"hotlineLine_id"
style=
"height:340px;"
></p>
</p>
</p>