Brak opisu

pieChat.js 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  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. function partOne() {
  5. $.ajax({
  6. type: "get",
  7. url: huayi.config.callcenter_url + "WOReport/GetChannel",
  8. async: true,
  9. dataType: "json",
  10. data: {},
  11. success: function(data) {
  12. if(data.state.toLowerCase() == "success") {
  13. var con = data.rows;
  14. container1.setOption({
  15. title: {
  16. text: '来源渠道数据分析',
  17. textStyle: {
  18. //文字颜色
  19. color: '#00e9ff',
  20. //字体大小
  21. fontSize: 18
  22. },
  23. x: 'center'
  24. },
  25. tooltip: {
  26. trigger: 'axis',
  27. axisPointer: {
  28. type: 'cross',
  29. label: {
  30. show: true,
  31. backgroundColor: '#030917'
  32. }
  33. }
  34. },
  35. legend: {
  36. show: false
  37. },
  38. xAxis: {
  39. name: '时间',
  40. data: [
  41. con[0].channel,
  42. con[1].channel,
  43. con[2].channel,
  44. con[3].channel,
  45. con[4].channel
  46. ],
  47. axisLine: {
  48. lineStyle: {
  49. color: '#ccc'
  50. }
  51. }
  52. },
  53. yAxis: {
  54. name: '数量',
  55. splitLine: {
  56. show: false
  57. },
  58. axisLine: {
  59. lineStyle: {
  60. color: '#fff'
  61. }
  62. }
  63. },
  64. series: [{
  65. name: '电话',
  66. type: 'line',
  67. data: [
  68. con[0].Telephone,
  69. con[1].Telephone,
  70. con[2].Telephone,
  71. con[3].Telephone,
  72. con[4].Telephone
  73. ]
  74. },
  75. {
  76. name: '微信',
  77. type: 'line',
  78. data: [
  79. con[0].WeChat,
  80. con[1].WeChat,
  81. con[2].WeChat,
  82. con[3].WeChat,
  83. con[4].WeChat
  84. ]
  85. }
  86. ],
  87. color: ['#61a0a9', '#cb885d']
  88. });
  89. }
  90. }
  91. });
  92. }
  93. function partTwo() {
  94. $.ajax({
  95. type: "get",
  96. url: huayi.config.callcenter_url + "WOReport/GetChannel",
  97. async: true,
  98. dataType: "json",
  99. data: {
  100. // date:
  101. },
  102. success: function(data) {
  103. if(data.state.toLowerCase() == "success") {
  104. var con = data.rows;
  105. container2.setOption({
  106. title: {
  107. text: '工单即时办结',
  108. textStyle: {
  109. //文字颜色
  110. color: '#00e9ff',
  111. //字体大小
  112. fontSize: 18
  113. },
  114. x: 'center'
  115. },
  116. color: ['#3398DB'],
  117. tooltip: {
  118. trigger: 'axis',
  119. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  120. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  121. }
  122. },
  123. grid: {
  124. left: '3%',
  125. right: '4%',
  126. bottom: '3%',
  127. containLabel: true
  128. },
  129. xAxis: [{
  130. type: 'category',
  131. data: [
  132. con[0].channel,
  133. con[1].channel,
  134. con[2].channel,
  135. con[3].channel,
  136. con[4].channel
  137. ],
  138. axisTick: {
  139. alignWithLabel: true
  140. },
  141. axisLine: {
  142. lineStyle: {
  143. color: '#ccc'
  144. }
  145. }
  146. }],
  147. yAxis: [{
  148. type: 'value',
  149. axisLine: {
  150. lineStyle: {
  151. color: '#ccc'
  152. }
  153. }
  154. }],
  155. series: [{
  156. name: '即时办结',
  157. type: 'bar',
  158. barWidth: '60%',
  159. data: [
  160. con[0].Immediate,
  161. con[1].Immediate,
  162. con[2].Immediate,
  163. con[3].Immediate,
  164. con[4].Immediate
  165. ]
  166. }]
  167. });
  168. }
  169. }
  170. });
  171. }
  172. function partThree() {
  173. $.ajax({
  174. type: "get",
  175. url: huayi.config.callcenter_url + "WOReport/GetChannel",
  176. async: true,
  177. dataType: "json",
  178. data: {
  179. // date:
  180. },
  181. success: function(data) {
  182. if(data.state.toLowerCase() == "success") {
  183. var con = data.rows;
  184. container3.setOption({
  185. title: {
  186. text: '转接率图表',
  187. textStyle: {
  188. //文字颜色
  189. color: '#00e9ff',
  190. //字体大小
  191.     fontSize: 18
  192. },
  193. x: 'center'
  194. },
  195. tooltip: {
  196. trigger: 'item',
  197. formatter: "{a} <br/>{b} : {c} ({d}%)"
  198. },
  199. legend: {
  200. orient: 'vertical',
  201. left: 'left'
  202. },
  203. series: [{
  204. name: '访问来源',
  205. type: 'pie',
  206. radius: '55%',
  207. center: ['50%', '60%'],
  208. data: [{
  209. value: con[0].Transfer,
  210. name: con[0].channel
  211. },
  212. {
  213. value: con[1].Transfer,
  214. name: con[1].channel
  215. },
  216. {
  217. value: con[2].Transfer,
  218. name: con[2].channel
  219. },
  220. {
  221. value: con[3].Transfer,
  222. name: con[3].channel
  223. },
  224. {
  225. value: con[4].Transfer,
  226. name: con[4].channel
  227. }
  228. ],
  229. itemStyle: {
  230. normal: {
  231. color: '#159FE9',
  232. opacity: 0.5,
  233. },
  234. emphasis: {
  235. shadowBlur: 10,
  236. shadowOffsetX: 0,
  237. shadowColor: 'rgba(0, 0, 0, 0.5)'
  238. }
  239. }
  240. }]
  241. });
  242. }
  243. }
  244. });
  245. }
  246. function partFour() {
  247. $.ajax({
  248. type: "get",
  249. url: huayi.config.callcenter_url + "WOReport/GetChannel",
  250. async: true,
  251. dataType: "json",
  252. data: {
  253. channel:$(".channelSel").val()
  254. },
  255. success: function(data) {
  256. if(data.state.toLowerCase() == "success") {
  257. var con = data.rows;
  258. var option={
  259. title: {
  260. text: '渠道来源满意度',
  261. x: 'left',
  262. textStyle: {
  263. //文字颜色
  264. color: '#00e9ff',
  265. //字体大小
  266.     fontSize: 18
  267. }
  268. },
  269. tooltip: {
  270. trigger: 'item',
  271. formatter: "{a} <br/>{b} : {c} ({d}%)"
  272. },
  273. legend: {
  274. orient: 'vertical',
  275. left: 'left'
  276. },
  277. series: [{
  278. name: '访问来源',
  279. type: 'pie',
  280. radius: '55%',
  281. center: ['50%', '60%'],
  282. data: [{
  283. value: con[0].Verysatisfied,
  284. name: '非常满意'
  285. },
  286. {
  287. value: con[0].Satisfaction,
  288. name: '满意'
  289. },
  290. {
  291. value: con[0].Commonly,
  292. name: '一般'
  293. },
  294. {
  295. value: con[0].Unsatisfactory,
  296. name: '不满意'
  297. }
  298. ],
  299. itemStyle: {
  300. normal: {
  301. color: '#159FE9',
  302. opacity: 0.5,
  303. },
  304. emphasis: {
  305. shadowBlur: 10,
  306. shadowOffsetX: 0,
  307. shadowColor: 'rgba(0, 0, 0, 0.5)'
  308. }
  309. }
  310. }]
  311. }
  312. echartsPie = echarts.init(document.getElementById('part4'));
  313. echartsPie.setOption(option);
  314. //var container4 = echarts.init(document.getElementById('part4'));
  315. }
  316. }
  317. });
  318. }