暫無描述

fuwuzhishi.js 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. var myChart = echarts.init(document.getElementById('fdcl'));
  2. option = {
  3. title: {
  4. text: '工单处理时间统计和分布',
  5. x: 'center',
  6. textStyle: {
  7. color: '#fff',
  8. fontSize: 18
  9. }
  10. },
  11. tooltip: {
  12. trigger: 'item',
  13. formatter: "{a} <br/>{b} : {c} ({d}%)"
  14. },
  15. legend: {
  16. orient: 'vertical',
  17. left: 'left',
  18. top: 50,
  19. inactiveColor: '#fff',
  20. textStyle: {
  21. color: '#fff',
  22. // fontSize: 16
  23. },
  24. data: ['知识库总数量', '通话总数量', '缺失总数量']
  25. },
  26. calculable: true,
  27. series: [{
  28. name: '占比',
  29. type: 'pie',
  30. selectedOffset: 5,
  31. radius: [50, 150],
  32. center: ['45%', '60%'],
  33. roseType: 'radius',
  34. label: {
  35. normal: {
  36. show: false
  37. },
  38. emphasis: {
  39. show: true
  40. }
  41. },
  42. lableLine: {
  43. normal: {
  44. show: false
  45. },
  46. emphasis: {
  47. show: true
  48. }
  49. },
  50. data: [{
  51. value: 10,
  52. name: '知识库总数量'
  53. }, {
  54. value: 5,
  55. name: '通话总数量'
  56. }, {
  57. value: 15,
  58. name: '缺失总数量'
  59. }, ]
  60. }],
  61. color: ['#eed147', '#acc977', '#ba466b'],
  62. };
  63. myChart.setOption(option);
  64. console.log(window.onresize);
  65. window.onresize = function() {
  66. myChart.resize();
  67. myChart.setOption(option);
  68. };
  69. //图2
  70. var myChart1 = echarts.init(document.getElementById('zs'));
  71. option = {
  72. title: {
  73. text: '工单处理时间统计和分布',
  74. x: 'center',
  75. textStyle: {
  76. color: '#fff',
  77. fontSize: 18
  78. }
  79. },
  80. tooltip: {
  81. trigger: 'axis',
  82. axisPointer: {
  83. type: 'shadow',
  84. label: {
  85. show: true,
  86. backgroundColor: '#333'
  87. }
  88. }
  89. },
  90. legend: {
  91. top: 30,
  92. data: ['咨询量', '缺失量'],
  93. textStyle: {
  94. color: '#ccc'
  95. }
  96. },
  97. xAxis: {
  98. data: ['市林业局', '市国土局', '市环保局', '市法制办', '市地震局', '市科技局', '市民政局', '市审计局', '市地煤炭局', '市地煤炭局'],
  99. axisLine: {
  100. lineStyle: {
  101. color: '#ccc'
  102. }
  103. },
  104. //文字旋转角度
  105. axisLabel: {
  106. interval: 0,
  107. rotate: 40,
  108. textStyle: {
  109. color: '#fff',
  110. fontSize: 12
  111. }
  112. }
  113. },
  114. yAxis: {
  115. splitLine: { show: false },
  116. axisLine: {
  117. lineStyle: {
  118. color: '#ccc'
  119. }
  120. }
  121. },
  122. series: [{
  123. name: '咨询量',
  124. type: 'line',
  125. smooth: true,
  126. showAllSymbol: true,
  127. symbol: 'emptyCircle',
  128. symbolSize: 15,
  129. data: [10, 15, 40, 44, 30, 50, 80, 62, 55, 32]
  130. }, {
  131. name: '缺失量',
  132. type: 'bar',
  133. barWidth: 10,
  134. itemStyle: {
  135. normal: {
  136. barBorderRadius: 5,
  137. color: new echarts.graphic.LinearGradient(
  138. 0, 0, 0, 1, [
  139. { offset: 0, color: '#14c8d4' },
  140. { offset: 1, color: '#43eec6' }
  141. ]
  142. )
  143. }
  144. },
  145. data: [20, 33, 80, 14, 60, 42, 99, 22, 36, 19]
  146. }]
  147. };
  148. myChart1.setOption(option);
  149. window.onresize = myChart1.resize;