analysisChartTopLeft.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <div>
  3. <div id="analysisChartTopLeft" @click="dialogVisible = true" style="width:6.8rem;height:2.5rem;"></div>
  4. <el-dialog title="HRSG 1#" :visible.sync="dialogVisible" width="1600px" @open="open" destroy-on-close append-to-body>
  5. <div id="analysisChartTopLeft2" style="width:20rem;height:6rem;margin:0.5rem auto;"></div>
  6. </el-dialog>
  7. </div>
  8. </template>
  9. <script>
  10. import echartMixins from "@/utils/resizeMixins";
  11. export default {
  12. data() {
  13. return {
  14. chart: null,
  15. dialogVisible: false
  16. }
  17. },
  18. mixins: [echartMixins],
  19. mounted() {
  20. this.init();
  21. },
  22. methods: {
  23. opnenDialg(){
  24. this.dialogVisible = true
  25. },
  26. open(){
  27. this.$nextTick(() => {
  28. this.init2()
  29. })
  30. },
  31. init() {
  32. this.chart = this.echarts.init(document.getElementById("analysisChartTopLeft"), 'dark');
  33. let option = {
  34. backgroundColor: 'transparent',
  35. title: {
  36. text: 'HRSG 1#',
  37. textStyle: {
  38. fontSize: 18
  39. }
  40. },
  41. tooltip: {
  42. trigger: 'axis'
  43. },
  44. legend: {
  45. data: ['烟尘', 'SO2', 'NOx'],
  46. padding: [30, 0, 0, 0]
  47. },
  48. grid: {
  49. left: '3%',
  50. right: '4%',
  51. bottom: '3%',
  52. containLabel: true
  53. },
  54. toolbox: {
  55. feature: {
  56. }
  57. },
  58. xAxis: {
  59. type: 'category',
  60. boundaryGap: false,
  61. data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
  62. axisLabel: {
  63. color: '#808080'
  64. },
  65. },
  66. yAxis: {
  67. type: 'value',
  68. name: 'Unit:(mg/m3)',
  69. axisLabel: {
  70. color: '#808080'
  71. },
  72. splitLine: {
  73. show: true,
  74. lineStyle:{
  75. color: 'rgba(255,255,255,.7)'
  76. }
  77. }
  78. },
  79. series: [
  80. {
  81. name: '烟尘',
  82. type: 'line',
  83. smooth: true,
  84. data: [80,90,70,20,10,60,50],
  85. symbolSize: 10,
  86. color: '#FF9800',
  87. lineStyle: {
  88. width: 3,
  89. },
  90. itemStyle: {
  91. borderWidth: 2,
  92. borderColor: '#fff',
  93. }
  94. },
  95. {
  96. name: 'SO2',
  97. type: 'line',
  98. smooth: true,
  99. data: [1400,2200,1300,1800,2500,1100,1300],
  100. symbolSize: 10,
  101. color: '#9D00FF',
  102. lineStyle: {
  103. width: 3,
  104. },
  105. itemStyle: {
  106. borderWidth: 2,
  107. borderColor: '#fff',
  108. }
  109. },
  110. {
  111. name: 'NOx',
  112. type: 'line',
  113. smooth: true,
  114. data: [400,200,300,800,500,100,300],
  115. symbolSize: 10,
  116. color: '#00FF0D',
  117. lineStyle: {
  118. width: 3,
  119. },
  120. itemStyle: {
  121. borderWidth: 2,
  122. borderColor: '#fff',
  123. }
  124. },
  125. ]
  126. };
  127. this.chart.setOption(option);
  128. },
  129. init2() {
  130. this.chart2 = this.echarts.init(document.getElementById("analysisChartTopLeft2"));
  131. let option = {
  132. backgroundColor: 'transparent',
  133. tooltip: {
  134. trigger: 'axis'
  135. },
  136. legend: {
  137. data: ['烟尘', 'SO2', 'NOx'],
  138. padding: [30, 0, 0, 0]
  139. },
  140. grid: {
  141. left: '3%',
  142. right: '4%',
  143. bottom: '3%',
  144. containLabel: true
  145. },
  146. toolbox: {
  147. feature: {
  148. }
  149. },
  150. xAxis: {
  151. type: 'category',
  152. boundaryGap: false,
  153. data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
  154. axisLabel: {
  155. color: '#808080'
  156. },
  157. },
  158. yAxis: {
  159. type: 'value',
  160. name: 'Unit:(mg/m3)',
  161. axisLabel: {
  162. color: '#808080'
  163. }
  164. },
  165. series: [
  166. {
  167. name: '烟尘',
  168. type: 'line',
  169. smooth: true,
  170. data: [80,90,70,20,10,60,50],
  171. symbolSize: 10,
  172. color: '#FF9800',
  173. lineStyle: {
  174. width: 3,
  175. },
  176. itemStyle: {
  177. borderWidth: 2,
  178. borderColor: '#fff',
  179. }
  180. },
  181. {
  182. name: 'SO2',
  183. type: 'line',
  184. smooth: true,
  185. data: [1400,2200,1300,1800,2500,1100,1300],
  186. symbolSize: 10,
  187. color: '#9D00FF',
  188. lineStyle: {
  189. width: 3,
  190. },
  191. itemStyle: {
  192. borderWidth: 2,
  193. borderColor: '#fff',
  194. }
  195. },
  196. {
  197. name: 'NOx',
  198. type: 'line',
  199. smooth: true,
  200. data: [400,200,300,800,500,100,300],
  201. symbolSize: 10,
  202. color: '#00FF0D',
  203. lineStyle: {
  204. width: 3,
  205. },
  206. itemStyle: {
  207. borderWidth: 2,
  208. borderColor: '#fff',
  209. }
  210. },
  211. ]
  212. };
  213. this.chart2.setOption(option);
  214. }
  215. },
  216. destroyed() {
  217. window.onresize = null;
  218. }
  219. }
  220. </script>
  221. <style>
  222. </style>