Nenhuma Descrição

pieChat.js 8.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. var container1 = echarts.init(document.getElementById('part1'));
  2. var container2 = echarts.init(document.getElementById('part2'));
  3. var container3 = echarts.init(document.getElementById('part3'));
  4. // var container7 = echarts.init(document.getElementById('patt7')); //大屏六个图
  5. function partOne() {
  6. $.ajax({
  7. type: "get",
  8. url: huayi.config.callcenter_url + "WOReport/GetChannel",
  9. async: true,
  10. dataType: "json",
  11. data: {},
  12. success: function(data) {
  13. if(data.state.toLowerCase() == "success") {
  14. var con = data.rows;
  15. container1.setOption({
  16. title: {
  17. text: '来源渠道数据分析',
  18. textStyle: {
  19. //文字颜色
  20. color: '#00e9ff',
  21. //字体大小
  22. fontSize: 18
  23. },
  24. x: 'center'
  25. },
  26. tooltip: {
  27. trigger: 'axis',
  28. axisPointer: {
  29. type: 'cross',
  30. label: {
  31. show: true,
  32. backgroundColor: '#030917'
  33. }
  34. }
  35. },
  36. legend: {
  37. show: false
  38. },
  39. xAxis: {
  40. name: '时间',
  41. data: [
  42. con[0].channel,
  43. con[1].channel,
  44. con[2].channel,
  45. con[3].channel,
  46. con[4].channel
  47. ],
  48. axisLine: {
  49. lineStyle: {
  50. color: '#ccc'
  51. }
  52. }
  53. },
  54. yAxis: {
  55. name: '数量',
  56. splitLine: {
  57. show: false
  58. },
  59. axisLine: {
  60. lineStyle: {
  61. color: '#fff'
  62. }
  63. }
  64. },
  65. series: [{
  66. name: '电话',
  67. type: 'line',
  68. data: [
  69. con[0].Telephone,
  70. con[1].Telephone,
  71. con[2].Telephone,
  72. con[3].Telephone,
  73. con[4].Telephone
  74. ]
  75. },
  76. {
  77. name: '微信',
  78. type: 'line',
  79. data: [
  80. con[0].WeChat,
  81. con[1].WeChat,
  82. con[2].WeChat,
  83. con[3].WeChat,
  84. con[4].WeChat
  85. ]
  86. }
  87. ],
  88. color: ['#61a0a9', '#cb885d']
  89. });
  90. }
  91. }
  92. });
  93. }
  94. function partTwo() {
  95. $.ajax({
  96. type: "get",
  97. url: huayi.config.callcenter_url + "WOReport/GetChannel",
  98. async: true,
  99. dataType: "json",
  100. data: {
  101. // date:
  102. },
  103. success: function(data) {
  104. if(data.state.toLowerCase() == "success") {
  105. var con = data.rows;
  106. container2.setOption({
  107. title: {
  108. text: '工单即时办结',
  109. textStyle: {
  110. //文字颜色
  111. color: '#00e9ff',
  112. //字体大小
  113. fontSize: 18
  114. },
  115. x: 'center'
  116. },
  117. color: ['#3398DB'],
  118. tooltip: {
  119. trigger: 'axis',
  120. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  121. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  122. }
  123. },
  124. grid: {
  125. left: '3%',
  126. right: '4%',
  127. bottom: '3%',
  128. containLabel: true
  129. },
  130. xAxis: [{
  131. type: 'category',
  132. data: [
  133. con[0].channel,
  134. con[1].channel,
  135. con[2].channel,
  136. con[3].channel,
  137. con[4].channel
  138. ],
  139. axisTick: {
  140. alignWithLabel: true
  141. },
  142. axisLine: {
  143. lineStyle: {
  144. color: '#ccc'
  145. }
  146. }
  147. }],
  148. yAxis: [{
  149. type: 'value',
  150. axisLine: {
  151. lineStyle: {
  152. color: '#ccc'
  153. }
  154. }
  155. }],
  156. series: [{
  157. name: '即时办结',
  158. type: 'bar',
  159. barWidth: '60%',
  160. data: [
  161. con[0].Immediate,
  162. con[1].Immediate,
  163. con[2].Immediate,
  164. con[3].Immediate,
  165. con[4].Immediate
  166. ]
  167. }]
  168. });
  169. }
  170. }
  171. });
  172. }
  173. function partThree() {
  174. $.ajax({
  175. type: "get",
  176. url: huayi.config.callcenter_url + "WOReport/GetChannel",
  177. async: true,
  178. dataType: "json",
  179. data: {
  180. // date:
  181. },
  182. success: function(data) {
  183. if(data.state.toLowerCase() == "success") {
  184. var con = data.rows;
  185. container3.setOption({
  186. title: {
  187. text: '转接率图表',
  188. textStyle: {
  189. //文字颜色
  190. color: '#00e9ff',
  191. //字体大小
  192.     fontSize: 18
  193. },
  194. x: 'center'
  195. },
  196. tooltip: {
  197. trigger: 'item',
  198. formatter: "{a} <br/>{b} : {c} ({d}%)"
  199. },
  200. legend: {
  201. orient: 'vertical',
  202. left: 'left'
  203. },
  204. series: [{
  205. name: '访问来源',
  206. type: 'pie',
  207. radius: '55%',
  208. center: ['50%', '60%'],
  209. data: [{
  210. value: con[0].Transfer,
  211. name: con[0].channel
  212. },
  213. {
  214. value: con[1].Transfer,
  215. name: con[1].channel
  216. },
  217. {
  218. value: con[2].Transfer,
  219. name: con[2].channel
  220. },
  221. {
  222. value: con[3].Transfer,
  223. name: con[3].channel
  224. },
  225. {
  226. value: con[4].Transfer,
  227. name: con[4].channel
  228. }
  229. ],
  230. itemStyle: {
  231. normal: {
  232. color: '#159FE9',
  233. opacity: 0.5,
  234. },
  235. emphasis: {
  236. shadowBlur: 10,
  237. shadowOffsetX: 0,
  238. shadowColor: 'rgba(0, 0, 0, 0.5)'
  239. }
  240. }
  241. }]
  242. });
  243. }
  244. }
  245. });
  246. }
  247. function partFour() {
  248. $.ajax({
  249. type: "get",
  250. url: huayi.config.callcenter_url + "WOReport/GetChannel",
  251. async: true,
  252. dataType: "json",
  253. data: {
  254. channel:$(".channelSel").val()
  255. },
  256. success: function(data) {
  257. if(data.state.toLowerCase() == "success") {
  258. var con = data.rows;
  259. var option={
  260. title: {
  261. text: '渠道来源满意度',
  262. x: 'left',
  263. textStyle: {
  264. //文字颜色
  265. color: '#00e9ff',
  266. //字体大小
  267.     fontSize: 18
  268. }
  269. },
  270. tooltip: {
  271. trigger: 'item',
  272. formatter: "{a} <br/>{b} : {c} ({d}%)"
  273. },
  274. legend: {
  275. orient: 'vertical',
  276. left: 'left'
  277. },
  278. series: [{
  279. name: '访问来源',
  280. type: 'pie',
  281. radius: '55%',
  282. center: ['50%', '60%'],
  283. data: [{
  284. value: con[0].Verysatisfied,
  285. name: '非常满意'
  286. },
  287. {
  288. value: con[0].Satisfaction,
  289. name: '满意'
  290. },
  291. {
  292. value: con[0].Commonly,
  293. name: '一般'
  294. },
  295. {
  296. value: con[0].Unsatisfactory,
  297. name: '不满意'
  298. }
  299. ],
  300. itemStyle: {
  301. normal: {
  302. color: '#159FE9',
  303. opacity: 0.5,
  304. },
  305. emphasis: {
  306. shadowBlur: 10,
  307. shadowOffsetX: 0,
  308. shadowColor: 'rgba(0, 0, 0, 0.5)'
  309. }
  310. }
  311. }]
  312. }
  313. echartsPie = echarts.init(document.getElementById('part4'));
  314. echartsPie.setOption(option);
  315. //var container4 = echarts.init(document.getElementById('part4'));
  316. }
  317. }
  318. });
  319. }
  320. // 第四屏
  321. // function partpaat() {
  322. // $.ajax({
  323. // type: "get",
  324. // url: huayi.config.callcenter_url + "WOReport/GetChannel",
  325. // async: true,
  326. // dataType: "json",
  327. // data: {},
  328. // success: function(data) {
  329. // if(data.state.toLowerCase() == "success") {
  330. // var con = data.rows;
  331. // container7.setOption({
  332. // title: {
  333. // text: '来源渠道数据分析',
  334. // textStyle: {
  335. // //文字颜色
  336. // color: '#00e9ff',
  337. // //字体大小
  338. // fontSize: 18
  339. // },
  340. // x: 'center'
  341. // },
  342. // tooltip: {
  343. // trigger: 'axis',
  344. // axisPointer: {
  345. // type: 'cross',
  346. // label: {
  347. // show: true,
  348. // backgroundColor: '#030917'
  349. // }
  350. // }
  351. // },
  352. // legend: {
  353. // show: false
  354. // },
  355. // xAxis: {
  356. // name: '时间',
  357. // data: [
  358. // con[0].channel,
  359. // con[1].channel,
  360. // con[2].channel,
  361. // con[3].channel,
  362. // con[4].channel
  363. // ],
  364. // axisLine: {
  365. // lineStyle: {
  366. // color: '#ccc'
  367. // }
  368. // }
  369. // },
  370. // yAxis: {
  371. // name: '数量',
  372. // splitLine: {
  373. // show: false
  374. // },
  375. // axisLine: {
  376. // lineStyle: {
  377. // color: '#fff'
  378. // }
  379. // }
  380. // },
  381. // series: [{
  382. // name: '电话',
  383. // type: 'bar',
  384. // barWidth:20,
  385. // data: [
  386. // con[0].Telephone,
  387. // con[1].Telephone,
  388. // con[2].Telephone,
  389. // con[3].Telephone,
  390. // con[4].Telephone
  391. // ]
  392. // },
  393. // {
  394. // name: '微信',
  395. // type: 'line',
  396. // data: [
  397. // con[0].WeChat,
  398. // con[1].WeChat,
  399. // con[2].WeChat,
  400. // con[3].WeChat,
  401. // con[4].WeChat
  402. // ]
  403. // },
  404. // {
  405. // type: 'pie',
  406. // id: 'pie',
  407. // radius: '40%',
  408. // center: ['60%', '30%'],
  409. // label: {
  410. // formatter: '{b}: {@2012} ({d}%)'
  411. // },
  412. // encode: {
  413. // itemName: 'product',
  414. // value: '2012',
  415. // tooltip: '2012'
  416. // }
  417. // }
  418. // ],
  419. // color: ['#61a0a9', '#cb885d']
  420. //
  421. // });
  422. //
  423. // }
  424. // }
  425. // });
  426. // }