| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342 |
- $(document).ready(function() {
- //part 1
- var main1 = echarts.init(document.getElementById('main1'));
- main1.setOption({
- tooltip: {
- trigger: 'item',
- formatter: "{a} <br/>{b} : {c} ({d}%)",
- axisPointer: {
- crossStyle: {
- color: '#fff'
- }
- }
- },
- legend: {
- // orient: 'vertical',
- bottom: 'bottom',
- data: [],
- textStyle: {
- color: '#fff'
- }
- },
- series: [{
- name: '数据',
- type: 'pie',
- radius: '55%',
- center: ['50%', '50%'],
- data: [],
- itemStyle: {
- emphasis: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- },
- normal:{
- label:{
- show: true,
- formatter: '{b} : {c} ({d}%)'
- },
- labelLine :{show:true}
- }
- },
- label: {
- normal: {
- textStyle: {
- color: '#fff'
- }
- }
- }
- }]
- });
- //part 2
- var phone_num = echarts.init(document.getElementById('phone_num'));
- phone_num.setOption({
- title: {
- // text: '投诉/举报汇总',
- x: 'center',
- textStyle: {
- color: '#fff',
- fontSize: 16
- },
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: { // 坐标轴指示器,坐标轴触发有效
- type: 'line' // 默认为直线,可选为:'line' | 'shadow'
- }
- },
- toolbox: {
- show: true,
- },
- calculable: true,
- xAxis: [{
- type: 'category',
- // name: '月份',
- splitLine: {
- show: false
- }, //去除网格线
- data: ["话务来电总量(通)", "接通总量(通)"],
- // axisTick: {
- // alignWithLabel: true
- // },
- axisLine: {
- show: false,
- lineStyle: {
- color: '#fff'
- }
- },
- // axisLine: {},
- axisTick: {
- show: false
- }
- }],
- yAxis: [{
- show: false
- }],
- series: [{
- name: '数量',
- type: 'bar',
- barWidth: '30%', //图形宽度
- data: [],
- itemStyle: {
- normal: {
- label: {
- show: true,
- textStyle: {
- color: '#fff' //顶部数据颜色
- }
- }
- }
- },
- label: {
- normal: {
- show: true,
- position: 'top' //顶部数据显示位置
- }
- }
- }
- ]
- // color: ['#ff9800','#61a0a8','#1ab394']
- });
-
- //接通率报表part3
- var jtv = echarts.init(document.getElementById('jtv_num'));
- jtv.setOption({
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow',
- label: {
- show: true,
- backgroundColor: '#333'
- }
- },
- formatter: function(datas)
- {
- var res = datas[0].name + '<br/>', val;
- for(var i = 0, length = datas.length; i < length; i++) {
- val = (datas[i].value) + '%';
- res += datas[i].seriesName + ':' + val + '<br/>';
- }
- return res;
- }
- },
- legend: {
- // top: 30,
- bottom:'bottom',
- data: [],
- textStyle: {
- color: '#fff'
- }
- },
- 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: []
- }]
- });
- //通话时长part4
- var th_nums = echarts.init(document.getElementById('th_nums'));
- th_nums.setOption({
- tooltip: {
- trigger: 'item',
- formatter: "{a} <br/>{b} : {c} ({d}%)",
- axisPointer: {
- crossStyle: {
- color: '#fff'
- }
- }
- },
- legend: {
- // orient: 'vertical',
- bottom: 'bottom',
- data: [],
- textStyle: {
- color: '#fff'
- }
- },
- series: [{
- name: '数据',
- type: 'pie',
- radius: '55%',
- center: ['50%', '50%'],
- data: [],
- itemStyle: {
- emphasis: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- },
- normal:{
- label:{
- show: true,
- formatter: '{b} : {c} ({d}%)'
- },
- labelLine :{show:true}
- }
- },
- label: {
- normal: {
- textStyle: {
- color: '#fff'
- }
- }
- }
- }]
- });
-
- Ajax();
- function Ajax(){
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "Info/GetScreen",
- async: true,
- dataType: "json",
- data: {
- // token: $.cookie("token")
- },
- success: function(data) {
- if(data.state.toLowerCase() == "success") {
- // layer.close(index);
- var part_a = data.data.a;//图二
- phone_num.setOption({
- series: [{
- data: [part_a.jtcount, part_a.zldcount]
- // data: [20, 100, 5, 80]
- }]
- })
- var part_b = data.data.b;//图1
- var part_1_legend =[];
- var part_1_ser = [];
- $(part_b).each(function(i,n){
- part_1_legend.push(n.Source);
- var part_1_obj = {};
- part_1_obj.value = n.Count;
- part_1_obj.name = n.Source;
- part_1_ser.push(part_1_obj)
- })
- main1.setOption({
- legend: {
- data: part_1_legend
- },
- series: [{
- data: part_1_ser
- }]
- })
-
- var part_c = data.data.c;//图3
- var part_3_legend =[];
- var part_3_ser = [];
- $(part_c).each(function(j,m){
- part_3_legend.push(m.DeptName)
- part_3_ser.push(m.Count)
- })
-
- jtv.setOption({
- // legend: {
- // data:part_3_legend,
- // },
- xAxis: {
- data:part_3_legend
- },
- series: [{
- data:part_3_ser
- }]
-
- })
-
- var part_d = data.data.d;//图4
- var part_4_legend =[];
- var part_4_ser = [];
- $(part_d).each(function(y,s){
- part_4_legend.push(s.TypeName);
- var part_4_obj = {};
- part_4_obj.value = s.Count;
- part_4_obj.name = s.TypeName;
- part_4_ser.push(part_4_obj)
- })
- th_nums.setOption({
- legend: {
- data: part_4_legend
- },
- series: [{
- data: part_4_ser
- }]
- })
-
-
-
-
-
- }
- }
- });
- }
- setInterval(Ajax, huayi.config.indextime); //Ajax调用函数
- })
|