//类型工单统计 var slhw = echarts.init(document.getElementById('slhw')); slhw.setOption({ title: { text: '工单类型统计', x: 'center', textStyle: { color: '#fff', fontSize: 16, fontWeight: 'normal' } }, legend: { // orient: 'vertical', bottom: 'bottom', data: [], textStyle: { color: '#fff' } }, tooltip: { trigger: 'item', formatter: "{a}
{b} : {c} ({d}%)" }, series: [{ name: '工单类型', type: 'pie', radius: '60%', center: ['50%', '55%'], data: [], itemStyle: { emphasis: { shadowBlur: 10, shadowOffsetX: 0, shadowColor: 'rgba(0, 0, 0, 0.5)' } } }] }); //接通率报表 var jtv = echarts.init(document.getElementById('jtv_num')); jtv.setOption({ title: { text: '接通率统计', x: 'center', textStyle: { color: '#fff', fontSize: 16, fontWeight: 'normal' } }, tooltip: { trigger: 'axis', axisPointer: { type: 'shadow', label: { show: true, backgroundColor: '#333' } }, formatter: function(datas) { var res = datas[0].name + '
', val; for(var i = 0, length = datas.length; i < length; i++) { val = (datas[i].value) + '%'; res += datas[i].seriesName + ':' + val + '
'; } return res; } }, legend: { top: 30, data: ['接通量', '挂断量', '未接量'], textStyle: { color: '#ccc' } }, xAxis: { name: '时', data: [], axisLine: { lineStyle: { color: '#ccc' } }, }, yAxis: { name: '比率', splitLine: { show: false }, axisLine: { lineStyle: { color: '#ccc' } } }, series: [{ name: '接通量', type: 'bar', barWidth: 8, itemStyle: { normal: { color: new echarts.graphic.LinearGradient( 0, 0, 0, 1, [{ offset: 0, color: '#14c8d4' }, { offset: 1, color: '#43eec6' } ] ) } }, data: [20, 33, 80, 14, 60, 42, 99, 22, 36, 19, 25, 30, 45, 80, 65, 55, 42, 50, 55, 66, 36, 23, 20, 21] }] }); //通话时长 var th_nums = echarts.init(document.getElementById('th_nums')); th_nums.setOption({ title: { text: '接通率统计', x: 'center', textStyle: { color: '#fff', fontSize: 16, fontWeight: 'normal' } }, tooltip: { trigger: 'axis', axisPointer: { type: 'shadow', label: { show: true, backgroundColor: '#333' } } }, legend: { top: 30, data: ['平均通话时长统计'], textStyle: { color: '#ccc' } }, xAxis: { name: '时', data: [], axisLine: { lineStyle: { color: '#ccc' } }, }, yAxis: { name: '时长', splitLine: { show: false }, axisLine: { lineStyle: { color: '#ccc' } } }, series: [{ name: '平均通话时长', type: 'line', smooth:true, showAllSymbol:true, symbol :"emptyCircle", symbolSize: 10, data: [] }] }); Ajax(); function Ajax(){ $('.gdmap-r ul').html(''); $('.gdmap-l ul').html(''); var index = layer.load(1, { shade: [0.5,'#f5f5f5'] //0.1透明度的白色背景 }); $.ajax({ type: "get", url: huayi.config.callcenter_url + "Info/GetCenterInfo", async: true, dataType: 'json', data: { }, success: function(data) { if(data.message.toLowerCase()=='加载成功'){ layer.close(index); var part1=data.data.d; var color=["z","l","a","t","y","g","w","b","1","2","3"]; var dindex=Math.floor(Math.random()*10+1); $(part1).each(function(i,n){ var dindex=Math.floor(Math.random()*10+1); $('
  • '+ ''+ ''+n.AreaName+''+ ''+ n.Count+''+ '
  • ').appendTo('.gdmap-r ul') }) var part2=data.data.a; var part2_legend = []; var part2_ser = []; $(part2).each(function(i,n){ var obj={}; if(i==1){ obj.value=n.count; obj.name=n.teptname; obj.selected=true; }else{ obj.value=n.count; obj.name=n.teptname; } part2_legend.push(n.teptname); part2_ser.push(obj); $('
  • '+ '
    '+n.teptname +'
    '+ ''+n.count +''+ '
  • ').appendTo('.gdmap-l ul'); }) slhw.setOption({ legend: { data: part2_legend }, series: [{ data: part2_ser }] }) var part3=data.data.b; jtv.setOption({ xAxis: { data:part3.hours }, series: [{ data:part3.rates }] }) var part4=data.data.c; th_nums.setOption({ xAxis: { data:part4.hours }, series: [{ data:part4.avgtimes }] }) } } }); setInterval(Ajax, huayi.config.indextime);//Ajax调用函数 }