index.html 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>后台首页</title>
  7. <link rel="shortcut icon" href="favicon.ico">
  8. <link href="https://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
  9. <link href="https://cdn.staticfile.org/font-awesome/4.4.0/css/font-awesome.css?v=4.4.0" rel="stylesheet">
  10. <link href="https://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
  11. <link href="__CSS__/style.min.css?v=4.1.0" rel="stylesheet">
  12. </head>
  13. <body class="gray-bg">
  14. <div class="wrapper wrapper-content">
  15. <div class="row">
  16. </div>
  17. <div class="row">
  18. <div class="col-sm-12">
  19. <div class="ibox float-e-margins">
  20. <div class="ibox-title">
  21. <h5>今日数据分析</h5>
  22. </div>
  23. <div class="ibox-content">
  24. <div class="ibox-content" style="height: 350px" id="bar">
  25. </div>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. <div class="wrapper wrapper-content">
  32. <div class="row">
  33. </div>
  34. <div class="row">
  35. <div class="col-sm-12">
  36. <div class="ibox float-e-margins">
  37. <div style="display: flex;">
  38. <div class="ibox-title" style="width: 50%;">
  39. <h5>今日数据分析</h5>
  40. </div>
  41. <div class="ibox-title" style="width: 50%;">
  42. <h5>今日数据分析</h5>
  43. </div>
  44. </div>
  45. <div class="ibox-content no-padding" style="display: flex;">
  46. <div class="ibox-content" style="width: 50%;height: 350px" id="pie_evaluate">
  47. </div>
  48. <div class="ibox-content" style="width: 50%;height: 350px" id="pie_system">
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <script src="https://cdn.staticfile.org/jquery/2.1.4/jquery.min.js"></script>
  56. <script src="https://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
  57. <script src="/static/admin/js/plugins/echarts/echarts.min.js"></script>
  58. <script type="text/javascript">
  59. var xData = {$xData};
  60. var chatData = {$chatData};
  61. var serviceData = {$serviceData};
  62. var queueData = {$queueData};
  63. var evaluate = {$evaluate};
  64. var systemCount = {$systemCount};
  65. // 基于准备好的dom,初始化echarts实例
  66. var myChart_bar = echarts.init(document.getElementById('bar'));
  67. var pie_evaluate = echarts.init(document.getElementById('pie_evaluate'));
  68. var pie_system = echarts.init(document.getElementById('pie_system'));
  69. // 指定图表的配置项和数据
  70. var option_bar = {
  71. color: ['#1da1f2', '#fa7070', '#fcbb07', '#90dd75', '#8fa6ec', '#157efb'],
  72. tooltip: {
  73. trigger: 'axis',
  74. axisPointer: {
  75. type: 'shadow'
  76. }
  77. },
  78. legend: {
  79. itemWidth: 20, //图例的宽度
  80. itemHeight: 8, //图例的高度
  81. itemGap: 40,
  82. left: '55',
  83. top: 'top',
  84. icon: 'rect',
  85. //selectedMode: false, //取消图例上的点击事件
  86. data: ['会话量', '消息量','排队量'],
  87. },
  88. grid: {
  89. left: '30',
  90. right: '30',
  91. bottom: '20',
  92. containLabel: true
  93. },
  94. toolbox: {
  95. show: true,
  96. orient: 'vertical',
  97. left: 'right',
  98. top: 'center',
  99. },
  100. calculable: true,
  101. xAxis: [{
  102. splitLine: {
  103. show: false
  104. }, //去除网格线
  105. splitArea: {
  106. show: false
  107. }, //保留网格区域
  108. axisLine: {
  109. show: true,
  110. lineStyle: { //轴上的线样式
  111. color: '#979797',
  112. width: 0.6, //这里是为了突出显示加上的
  113. },
  114. },
  115. axisTick: {
  116. show: false
  117. },
  118. axisLabel: { //轴上的数据样式
  119. color: '#393C40',
  120. },
  121. data: xData,
  122. }],
  123. yAxis: [{
  124. // type: 'value',
  125. splitLine: {
  126. show: false
  127. }, //去除网格线
  128. splitArea: {
  129. show: false
  130. }, //保留网格区域
  131. axisLine: {
  132. show: true,
  133. lineStyle: { //轴上的线样式
  134. color: '#979797',
  135. width: 0.6, //这里是为了突出显示加上的
  136. },
  137. },
  138. axisTick: {
  139. show: false
  140. },
  141. axisLabel: { //轴上的数据样式
  142. color: '#393C40',
  143. }
  144. }],
  145. series: [
  146. {
  147. name: '会话量',
  148. type: 'bar',
  149. barWidth: 24,// 柱形的宽度
  150. barGap: 0,
  151. data: serviceData
  152. },
  153. {
  154. name: '消息量',
  155. type: 'bar',
  156. barWidth: 24,// 柱形的宽度
  157. barGap: 0,
  158. data: chatData
  159. },
  160. {
  161. name: '排队量',
  162. type: 'bar',
  163. barWidth: 24,// 柱形的宽度
  164. barGap: 0,
  165. data: queueData
  166. }
  167. ]
  168. };
  169. // 使用刚指定的配置项和数据显示图表。
  170. myChart_bar.setOption(option_bar);
  171. // 指定图表的配置项和数据
  172. var option_PE = {
  173. backgroundColor: '#fff',
  174. tooltip: {
  175. trigger: 'item',
  176. formatter: "{b} : {c} ({d}%)"
  177. },
  178. visualMap: {
  179. show: false,
  180. min: 500,
  181. max: 600,
  182. inRange: {
  183. //colorLightness: [0, 1]
  184. }
  185. },
  186. series: [{
  187. name: '满意度',
  188. type: 'pie',
  189. radius: '50%',
  190. center: ['50%', '50%'],
  191. color: ['rgb(131,249,103)', '#FBFE27', '#FE5050', '#1DB7E5'], //'#FBFE27','rgb(11,228,96)','#FE5050'
  192. data: [
  193. {
  194. value: evaluate['evaluateGood'],
  195. name: '满意'
  196. }, {
  197. value: evaluate['evaluateSecondary'],
  198. name: '一般'
  199. }, {
  200. value: evaluate['evaluateBad'],
  201. name: '不满意'
  202. }, {
  203. value: evaluate['evaluateNo'],
  204. name: '未评价'
  205. }
  206. ].sort(function(a, b) {
  207. return a.value - b.value
  208. }),
  209. roseType: 'radius',
  210. label: {
  211. normal: {
  212. formatter: ['{c|{c}次}', '{b|{b}}'].join('\n'),
  213. rich: {
  214. c: {
  215. color: 'rgb(241,246,104)',
  216. fontSize: 20,
  217. fontWeight:'bold',
  218. lineHeight: 5
  219. },
  220. b: {
  221. color: 'rgb(98,137,169)',
  222. fontSize: 15,
  223. height: 40
  224. },
  225. },
  226. }
  227. },
  228. labelLine: {
  229. normal: {
  230. lineStyle: {
  231. color: 'rgb(98,137,169)',
  232. },
  233. smooth: 0.2,
  234. length: 10,
  235. length2: 20,
  236. }
  237. },
  238. itemStyle: {
  239. normal: {
  240. shadowColor: 'rgba(0, 0, 0, 0.8)',
  241. shadowBlur: 50,
  242. }
  243. }
  244. }]
  245. };
  246. var option_PS = {
  247. backgroundColor: '#fff',
  248. tooltip: {
  249. trigger: 'item',
  250. formatter: "{b} : {c} ({d}%)"
  251. },
  252. visualMap: {
  253. show: false,
  254. min: 500,
  255. max: 600,
  256. inRange: {
  257. //colorLightness: [0, 1]
  258. }
  259. },
  260. series: [{
  261. name: '满意度',
  262. type: 'pie',
  263. radius: '50%',
  264. center: ['50%', '50%'],
  265. color: ['rgb(131,249,103)', '#FBFE27', '#FE5050', '#1DB7E5'], //'#FBFE27','rgb(11,228,96)','#FE5050'
  266. data: systemCount.sort(function(a, b) {
  267. return a.value - b.value
  268. }),
  269. roseType: 'radius',
  270. label: {
  271. normal: {
  272. formatter: ['{c|{c}次}', '{b|{b}}'].join('\n'),
  273. rich: {
  274. c: {
  275. color: 'rgb(241,246,104)',
  276. fontSize: 20,
  277. fontWeight:'bold',
  278. lineHeight: 5
  279. },
  280. b: {
  281. color: 'rgb(98,137,169)',
  282. fontSize: 15,
  283. height: 40
  284. },
  285. },
  286. }
  287. },
  288. labelLine: {
  289. normal: {
  290. lineStyle: {
  291. color: 'rgb(98,137,169)',
  292. },
  293. smooth: 0.2,
  294. length: 10,
  295. length2: 20,
  296. }
  297. },
  298. itemStyle: {
  299. normal: {
  300. shadowColor: 'rgba(0, 0, 0, 0.8)',
  301. shadowBlur: 50,
  302. }
  303. }
  304. }]
  305. };
  306. // 使用刚指定的配置项和数据显示图表。
  307. pie_evaluate.setOption(option_PE);
  308. pie_system.setOption(option_PS);
  309. </script>
  310. </body>
  311. </html>