From c77abda3614ba5c0a317b92eef29edbb39501d8f Mon Sep 17 00:00:00 2001
From: zhangshuaibao <15731629597@163.com>
Date: 星期一, 12 四月 2021 18:52:14 +0800
Subject: [PATCH] echarts的数据显示功能

---
 src/components/BaseNav/PublicBounced/GasComponents/EChartsHour.vue |  653 +++++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 452 insertions(+), 201 deletions(-)

diff --git a/src/components/BaseNav/PublicBounced/GasComponents/EChartsHour.vue b/src/components/BaseNav/PublicBounced/GasComponents/EChartsHour.vue
index 831d249..d3af27b 100644
--- a/src/components/BaseNav/PublicBounced/GasComponents/EChartsHour.vue
+++ b/src/components/BaseNav/PublicBounced/GasComponents/EChartsHour.vue
@@ -3,10 +3,10 @@
     <div id="Tab">
         <div class="infomation">
           <div>
-            <span class="grid-content">姘哀鍖栫墿 : 29.93 鏍囧噯 : 100</span>
-            <span class="grid-content">浜屾哀鍖栫~ : 17.34 鏍囧噯 : 50</span>
-            <span class="grid-content">鐑熷皹 : 6.93 鏍囧噯 : 30</span>
-            <span class="grid-content">搴熸皵娴侀噺 : 120343.18</span>
+            <span class="grid-content">姘哀鍖栫墿 :<i>29.93</i>  鏍囧噯 : 100</span>
+            <span class="grid-content">浜屾哀鍖栫~ : <i>17.34</i> 鏍囧噯 : 50</span>
+            <span class="grid-content">鐑熷皹 : <i>6.93</i> 鏍囧噯 : 30</span>
+            <span class="grid-content">搴熸皵娴侀噺 : <i>120343.18</i></span>
           </div>
         </div>
         <div class="form-echrts">
@@ -15,7 +15,7 @@
                     <div class="pickerData">
                         <span> 寮�濮嬫椂闂�:</span>
                         <span class="pickerTable">
-                          <el-date-picker  type="datetime"   v-model="value1">
+                          <el-date-picker  type="datetime"   v-model="formInline.timeStart">
                       </el-date-picker>
                       </span>
                     </div>
@@ -24,7 +24,7 @@
                         <span class="pickerTable">
                         <el-date-picker
                                 type="datetime"
-                                v-model="value2"
+                                v-model="formInline.timeEnd"
                         >
                       </el-date-picker>
                       </span>
@@ -32,7 +32,7 @@
                 </div>
                 <div>
                     閲囨牱鐐规暟:
-                    <el-select v-model="formInline.region" placeholder="50">
+                    <el-select v-model="formInline.region">
                         <el-option label="0" value="0"></el-option>
                         <el-option label="25" value="25"></el-option>
                         <el-option label="50" value="50"></el-option>
@@ -78,14 +78,454 @@
       myChar: null,
       value: '',
       formInline: {
-        user: '',
-        region: ''
+        region: '',
+        timeStart: '',
+        timeEnd: ''
+      },
+      myChart: null,
+      JsonCtarts: {
+        id: 'mychart',
+        title: '鍔犵儹鐐夌儫姘�',
+        legend: [
+          {
+            icon: 'image://../assets/imgs/legend/NOX.png',
+            itemHeight: 5,
+            itemWidth: 20,
+            textStyle: {
+              color: '#CCC'
+            },
+            name: '姘哀鍖栫墿'
+          },
+          {
+            icon: 'image://../assets/imgs/legend/SO2.png',
+            itemHeight: 5,
+            itemWidth: 20,
+            name: '浜屾哀鍖栫~',
+            textStyle: {
+              color: '#CCC'
+            }
+          },
+          {
+            icon: 'image://../assets/imgs/legend/YanChen.png',
+            itemHeight: 5,
+            itemWidth: 20,
+            name: '鐑熷皹',
+            textStyle: { color: '#ccc' }
+          },
+          {
+            icon: 'image://../assets/imgs/legend/WenDu.png',
+            itemHeight: 5,
+            itemWidth: 20,
+            name: '娓╁害',
+            textStyle: { color: '#ccc' }
+          },
+          {
+            icon: 'image://../assets/imgs/legend/VOCs.png',
+            itemHeight: 5,
+            itemWidth: 20,
+            name: '搴熸皵娴侀噺',
+            textStyle: { color: '#ccc' }
+          }
+        ],
+        xdata: ['0鏃�', '1鏃�', '2鏃�', '3鏃�', '4鏃�', '5鏃�', '6鏃�', '7鏃�', '8鏃�', '9鏃�', '10鏃�', '11鏃�', '12鏃�', '13鏃�', '14鏃�', '15鏃�', '16鏃�'],
+        ydatas: [
+          { name: '姘哀鍖栫墿', data: ['34.44', '36.91', '37.65', '37.16', '38.03', '38.23', '37.21', '37.67', '37.97', '37.58', '36.61', '37.76', '37.27', '37.24', '35.86', 'NaN', 'NaN'], zdcbcolor: 'red', zxcolor: '#00B0F0', bzz: 50 },
+          { name: '浜屾哀鍖栫~', data: ['4.98', '4.57', '4.19', '3.14', '3.80', '3.62', '3.33', '2.80', '3.13', '2.54', '3.08', '2.48', '1.97', '1.76', '0.82', 'NaN', 'NaN'], zdcbcolor: 'red', zxcolor: '#fff21c', bzz: 35 },
+          { name: '搴熸皵娴侀噺', data: ['381907.22', '376474.19', '378572.31', '379369.44', '385225.72', '388657.56', '330667.31', '26560.98', '0.00', '0.00', '49567.43', '357837.31', '376972.66', '379693.50', '379982.22', 'NaN', 'NaN'], zdcbcolor: 'red', zxcolor: '#9ACD32', bzz: null },
+          { name: '鐑熷皹', data: ['4.02', '4.17', '4.31', '4.00', '4.45', '4.40', '4.40', '4.25', '4.26', '4.18', '4.58', '4.21', '3.96', '3.83', '3.78', 'NaN', 'NaN'], zdcbcolor: 'red', zxcolor: '#f48183', bzz: 10 },
+          { name: '娓╁害', data: ['46.55', '46.70', '46.47', '46.56', '46.57', '46.58', '46.56', '46.58', '46.69', '46.47', '46.58', '46.60', '46.54', '46.55', '46.60', 'NaN', 'NaN'], zdcbcolor: 'red', zxcolor: '#F206FF', bzz: null }
+        ],
+        yname: ' 娴撳害(mg/m鲁)',
+        // id:'mychart',
+        datatype: 2
       }
     }
   },
   methods: {
     onSubmit () {
-      console.log('submit!')
+      console.log(1)
+
+      // const date = [this.value1, this.value2, this.formInline.region]
+      // if (this.$attrs.)
+      // console.log(this.$attrs.)
+      this.CreateChart(this.JsonCtarts.id, this.JsonCtarts.title, this.JsonCtarts.legend, this.JsonCtarts.xdata, this.JsonCtarts.ydatas, this.JsonCtarts.yname, this.JsonCtarts.id, this.JsonCtarts.datatype)
+      // console.log(date)
+      // if (date) {
+      //   var date1 = new Date(date)
+      //   date1 = new Date(date1.getTime() - (8 * 3600000))
+      //   console.log(date1)
+      // var dateUtil = new DateUtil()
+      // var datePkg = dateUtil.getTowDate(date1, "a", 24 * 3600000 - 1);
+      // var datatype = 2;
+    },
+    CreateChart: function (id, title, legend, xdata, ydatas, yname, jcdID, datatype) {
+      this.myChart = this.$echarts.init(this.$refs.main)
+      this.myChart.clear()
+      var dataUnit = ''
+      if (datatype === 1) {
+        dataUnit = '姘旈噺(m鲁/d)'
+      } else {
+        dataUnit = '姘旈噺(m鲁/h)'
+      }
+
+      var serLists = []
+      for (var j = 0; j < ydatas.length; j++) {
+        var len = ydatas[j].data.length
+        for (var k = 0; k < len; k++) {
+          var it = ydatas[j].data[k]
+          var it2 = parseFloat(it).toFixed(2)
+          ydatas[j].data[k] = it2
+        }
+      }
+
+      for (var i = 0; i < ydatas.length; i++) {
+      //  var zdcbcolor = ydatas[i].zdcbcolor
+        var bzz = ydatas[i].bzz
+        var obj
+        if (bzz == null) {
+          obj = {
+            name: ydatas[i].name,
+            symbol: 'circle', // 鎶樼偣褰㈢姸
+            symbolSize: 10, // 澶у皬
+            smooth: false, // 鐩寸嚎 锛宼rue 涓烘洸绾�
+            yAxisIndex: 1,
+            itemStyle: {
+              normal: {
+                color: function (c) { // 鏍规嵁value 鏄剧ず涓嶅悓鐨勬姌鐐归鑹�
+                  /* var biaozhuiz
+                  for (var i = 0; i < exhbzzList.length; i++) {
+                    if (exhbzzList[i].name == c.seriesName) {
+                      biaozhuiz = exhbzzList[i].bzhui
+                    }
+                  }
+                  if (c.value > 999999999999) {
+                    return zdcbcolor
+                  } else {
+                    return '#33c95f'
+                  } */
+                },
+                lineStyle: { // 鎶樼嚎鐨勯鑹�
+                  color: ydatas[i].zxcolor,
+                  width: 5
+                },
+                borderColor: ydatas[i].zxcolor, // 鎶樼偣杈规鐨勯鑹�
+                label: { // 鏄剧ず鍊�
+                  show: false
+                }
+              }
+            },
+            type: 'line',
+            data: ydatas[i].data
+          }
+        } else {
+          obj = {
+            name: ydatas[i].name,
+            symbol: 'circle', // 鎶樼偣褰㈢姸
+            symbolSize: 10, // 澶у皬
+            smooth: false, // 鐩寸嚎 锛宼rue 涓烘洸绾�
+            itemStyle: {
+              normal: {
+                color: function (c) { // 鏍规嵁value 鏄剧ず涓嶅悓鐨勬姌鐐归鑹�
+                /*  var biaozhuiz
+                  for (var i = 0; i < exhbzzList.length; i++) {
+                    if (exhbzzList[i].name == c.seriesName) {
+                      biaozhuiz = exhbzzList[i].bzhui
+                    }
+                  }
+                  if (c.value > biaozhuiz) {
+                    return zdcbcolor
+                  } else if (c.value > biaozhuiz * 0.9) {
+                    return '#FFA500'
+                  } else {
+                    return '#33c95f'
+                  }
+                  */
+                },
+                lineStyle: { // 鎶樼嚎鐨勯鑹�
+                  color: ydatas[i].zxcolor,
+                  width: 5
+                },
+                borderColor: ydatas[i].zxcolor, // 鎶樼偣杈规鐨勯鑹�
+                label: { // 鏄剧ず鍊�
+                  show: false
+                }
+              }
+            },
+            type: 'line',
+            data: ydatas[i].data,
+            markLine: { // 骞冲潎鍊� 锛� 鍜� 鎸囨爣涓婇檺
+              symbol: 'none',
+              data: [
+                /* {
+                     type: 'average',
+                     name: '鏃ュ钩鍧囧��',
+                     label: {
+                         normal: {
+                             position: 'end',  //鏄剧ず浣嶇疆
+                             formatter:  ydatas[i].name+'\n鏃ュ钩鍧囧��'+'{c}' //鏄剧ず鏍峰紡
+                         }
+                     },
+                     lineStyle:{   // 棰滆壊
+                         color: 'yellow',
+                         type:'solid'
+                     }
+                 }, */ {
+                  label: {
+                    normal: {
+                      position: 'end',
+                      formatter: '' // ydatas[i].name+'鏍囧噯鍊�'//+'{c}'
+                    }
+                  },
+                  name: '鏍囧噯鍊�',
+                  yAxis: bzz,
+                  lineStyle: {
+                    color: ydatas[i].zxcolor,
+                    type: 'dashed',
+                    width: 2
+                  }
+                }
+              ]
+            }
+          }
+        }
+        serLists.push(obj)
+      }
+
+      var option = {
+        tooltip: { // 鎻愮ず妗�
+          trigger: 'axis',
+          axisPointer: {
+            type: 'cross',
+            label: {
+              color: '#1a4245'
+            }
+          },
+          formatter: function (params) {
+            var s = params[0].name + '<br/>'
+            for (var i = 0; i < params.length; i++) {
+              // const name = params[i].name
+              // 鍥捐〃title鍚嶇О
+              var seriesName = params[i].seriesName
+              // 鍊�
+              var value = params[i].value
+              var valueFliter
+              if (value === 'NaN') {
+                valueFliter = ''
+              } else {
+                // valueFliter = formatter(value)
+              }
+              var maker = params[i].marker
+              if (seriesName === '浜屾哀鍖栫~') {
+                maker = '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:#fff21c;"></span>'
+              } else if (seriesName === '姘哀鍖栫墿') {
+                maker = '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:#00B0F0;"></span>'
+              } else if (seriesName === '鐑熷皹') {
+                maker = '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:#f48183;"></span>'
+              } else if (seriesName === '娓╁害') {
+                maker = '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:#F206FF;"></span>'
+              } else {
+                maker = '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:#4ec99c;"></span>'
+              }
+              s += maker + seriesName + ':' + valueFliter + '<br />'
+            }
+            return s
+          }
+        },
+        toolbox: { // 鎵撳嵃绛夊伐鍏�
+          show: false,
+          feature: {
+            saveAsImage: {}
+          }
+        },
+        grid: { // 缃戞牸
+          top: '20%',
+          left: '5%'
+          // containLabel: true
+        },
+        legend: { // 鍥句緥
+          data: legend
+        },
+        dataZoom: [{
+          type: 'inside',
+          start: 0,
+          end: 100
+        }, {
+          start: 0,
+          end: 100,
+          show: false,
+          handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
+          handleSize: '80%',
+          handleStyle: {
+            color: '#fff',
+            shadowBlur: 3,
+            shadowColor: 'rgba(0, 0, 0, 0.6)',
+            shadowOffsetX: 2,
+            shadowOffsetY: 2
+          }
+        }],
+        xAxis: { // x 杞磋缃�
+          type: 'category',
+          boundaryGap: false,
+          axisLabel: { // x杞村叏閮ㄦ樉绀�
+            rotate: 20,
+            interval: 0,
+            textStyle: {
+              color: '#fff'
+            }
+          },
+          splitLine: { // 缃戞牸鍨傜洿绾夸负 铏氱嚎
+            show: true,
+            lineStyle: {
+              type: 'dashed'
+            }
+          },
+          axisTick: { // x 杞村埢搴︽樉绀�
+            show: false
+          },
+          axisLine: {
+            lineStyle: {
+              color: '#FFFFFF',
+              width: 1// 杩欓噷鏄负浜嗙獊鍑烘樉绀哄姞涓婄殑
+            }
+          },
+          data: xdata
+        },
+        yAxis: [{
+          type: 'value',
+          name: yname,
+          /* max: function (value) {
+            var max_val_list = [] // 鎵�鏈夋樉绀烘姌绾跨殑鏍囧噯鍊�
+            // if(exhbzzList && exhbzzList.length>0){
+            //   if (value.max != "-Infinity") {  // 鑾峰彇鎵�鏈夌洃娴嬫寚鏍囩殑max鍊� 2020/12/31
+            //     valMax = parseInt(value.max + 5);
+            //   }
+            //   $.each(exhbzzList, function (index, item) {
+            //     if (item.bzhui != null) {
+            //       max_val_list.push(item.bzhui);
+            //     }
+            //   });
+            // }
+            max_val_list = max_val_list.sort(function (a, b) { return a - b }) // 鎺掑簭
+            var ma = value.max > max_val_list[max_val_list.length - 1] ? value.max + 5 : max_val_list[max_val_list.length - 1]
+            return parseInt(ma)
+          }, */
+          axisLabel: {
+            formatter: '{value}',
+            textStyle: {
+              color: '#fff'
+            }
+          },
+          axisPointer: {
+            snap: true
+          },
+          splitLine: {
+            show: false
+          }, // y杞� 缃戞牸绾夸笉鏄剧ず,
+          axisLine: {
+            lineStyle: {
+              color: '#FFFFFF',
+              width: 1// 杩欓噷鏄负浜嗙獊鍑烘樉绀哄姞涓婄殑
+            }
+          }
+        }, {
+          type: 'value',
+          name: dataUnit,
+          max: function (value) {
+            var ma = value.max > 120 ? value.max : 120
+            return parseInt(ma)
+          },
+          axisLabel: {
+            formatter: '{value}',
+            textStyle: {
+              color: '#fff'
+            }
+          },
+          axisPointer: {
+            snap: true
+          },
+          splitLine: {
+            show: false
+          }, // y杞� 缃戞牸绾夸笉鏄剧ず,
+          axisLine: {
+            lineStyle: {
+              color: '#FFFFFF',
+              width: 1// 杩欓噷鏄负浜嗙獊鍑烘樉绀哄姞涓婄殑
+            }
+          }
+        }],
+        series: serLists
+      }
+      this.myChart.setOption(option)
+      /*
+      this.myChart.on('legendselectchanged', function (params) {
+        var StdVal = null
+        var op = { yAxis: {} }
+        const max_val_list = [] // 鎵�鏈夋樉绀烘姌绾跨殑鏍囧噯鍊�
+        if (exhbzzList && exhbzzList.length > 0) {
+          max_val_list.push(valMax) // 灏嗙洃娴嬫寚鏍囩殑max鍊间篃鏀惧叆鏁扮粍 2020/12/31
+          $.each(exhbzzList, function (index, item) {
+            params.selected[item.name] ? max_val_list.push(item.bzhui) : ''
+            if (item.name == params.name) {
+              item.name == 'VOCs' ? StdVal = 20 : StdVal = item.bzhui
+            }
+          })
+        }
+        max_val_list = max_val_list.sort(function (a, b) { return a - b }) // 鎺掑簭
+        op.yAxis.max = function (value) {
+          var ma = value.max < StdVal ? StdVal : Math.ceil(value.max)
+          max_val_list ? ma = max_val_list[max_val_list.length - 1] : ''// 閫夋嫨鏈�澶у��
+          return ma
+        }
+        this.myChart.setOption(op)
+      })
+        */
+
+      /**
+       * 瑙e喅myChart.on('click',function(){...})浜嬩欢閲嶅瑙﹀彂鐨勯棶棰�
+       * Date: 20200720
+       */
+      this.myChart.off('click')
+
+      /**
+       *  鍥炬爣鐐瑰嚮浜嬩欢
+       *  20190426 add
+       * */
+      /* this.myChart.on('click', function (params) {
+        // 鑾峰彇褰撳墠鏃堕棿锛屽皬鏃�
+        var nowHours = new Date().Format('hh')
+        // 鐐瑰嚮鎶樼嚎鍥炬姌鐐瑰搴旂殑鏃堕棿
+        // 闇�瑕佷紶鐨勬椂闂翠负
+        const dates = null
+        if (params.name.indexOf('鏃�') !== -1) {
+          var hours = params.name.substring(0, params.name.indexOf('鏃�'))
+          if (parseInt(hours) < parseInt(nowHours)) {
+            dates = new Date().Format('yyyy-MM-dd') + ' ' + hours + ':00:00'
+          } else {
+            var currentDate = new Date()
+            // 24灏忔椂涔嬪墠鏃堕棿
+            var stringDate = new Date(currentDate.getTime() - 24 * 60 * 60 * 1000).Format('yyyy-MM-dd')
+            dates = stringDate + ' ' + hours + ':00:00'
+          }
+        } else if (params.name.indexOf('鏃�') !== -1) {
+          var day = params.name.substring(0, params.name.indexOf('鏃�') - 1)
+          dates = new Date().Format('yyyy-MM') + '-' + day.trim()
+        }
+
+        // todo 璋冩帴鍙� 鏌ュ嚟璇�
+         if (params.color != 'red') {
+          var poltMtrlId
+          var monItemId = 28
+          for (var i = 0; i < wrwIDS.length; i++) {
+            if (params.seriesName == wrwIDS[i].name) {
+              poltMtrlId = wrwIDS[i].id
+            }
+          }
+          getCBMX(jcdID, poltMtrlId, monItemId, _date, function (res) {
+            createDivByMouse(res, params.event)
+          })
+        }
+        // createDivByMouse("s",params.event);
+      }) */
     },
     drawChart: function () {
       window.onresize = function () {
@@ -99,199 +539,10 @@
         }
         this.myChart.resize()
       }
-    },
-    initOptions: function (dataDate, dataValue1, dataValue2, dataValue3) {
-      var options = {
-        title: {
-          // text: '鎶樼嚎鍥惧爢鍙�'
-        },
-        color: ['#5470c6', '#91CC75', '#EE6666', '#FF0087'],
-        tooltip: {
-          trigger: 'axis',
-          axisPointer: {
-            type: 'cross',
-            label: {
-              color: '#1a4245'
-            }
-          }
-        },
-        legend: {
-          x: '200px',
-          y: '30px',
-          data: [{
-            name: 'COD',
-            textStyle: {
-              color: '#00d0f9'
-            }
-          },
-          {
-            name: '姘ㄦ爱',
-            textStyle: {
-              color: '#00d0f9'
-            }
-          },
-          {
-            name: '搴熸按娴侀噺',
-            textStyle: {
-              color: '#00d0f9'
-            }
-          }]
-        },
-        grid: {
-          left: '3%',
-          right: '3%',
-          bottom: '3%',
-          containLabel: true
-        },
-        toolbox: {},
-        // 鍥炬爣缂╂斁璁剧疆
-        dataZoom: [{
-          type: 'inside',
-          start: 0,
-          end: 100
-        }, {
-          start: 0,
-          end: 100,
-          show: false,
-          // handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
-          handleSize: '80%',
-          handleStyle: {
-            color: '#fff',
-            shadowBlur: 3,
-            shadowColor: 'rgba(0, 0, 0, 0.6)',
-            shadowOffsetX: 2,
-            shadowOffsetY: 2
-          }
-        }],
-        // x杞寸殑璁剧疆
-        xAxis: {
-          type: 'category',
-          boundaryGap: false,
-          data: dataDate,
-          axisLabel: { // x杞村叏閮ㄦ樉绀�
-            rotate: 20,
-            interval: 0,
-            textStyle: {
-              color: '#fff',
-              fontSize: 10
-            }
-          },
-          splitLine: { // 缃戞牸鍨傜洿绾夸负铏氱嚎
-            show: true,
-            lineStyle: {
-              type: 'dashed'
-            }
-          },
-          axisTick: { // x 杞村埢搴︽樉绀�
-            show: false
-          },
-          axisLine: {
-            lineStyle: {
-              color: '#FFFFFF',
-              width: 1 // 杩欓噷鏄负浜嗙獊鍑烘樉绀哄姞涓婄殑
-            }
-          }
-        },
-        // Y 杞寸殑璁剧疆
-        yAxis: [{
-          type: 'value',
-          position: 'left', // 澶� Y 杞翠娇鐢�
-          name: '娴撳害(mg/m鲁)',
-          axisLabel: {
-            formatter: '{value}',
-            textStyle: {
-              color: '#fff' // 鍧愭爣鐨勫瓧浣撻鑹�
-            }
-          },
-          axisPointer: {
-            snap: true // 鑷姩鍚搁檮鏈�杩戠殑鐐�
-          },
-          splitLine: {
-            show: false // y杞� 缃戞牸绾夸笉鏄剧ず
-          },
-          axisLine: {
-            lineStyle: {
-              color: '#ffffff', // 鍧愭爣杞寸殑棰滆壊
-              width: 1
-            }
-          }
-        },
-        {
-          type: 'value',
-          position: 'right', // 澶� Y 杞翠娇鐢�
-          name: '娴侀噺(m鲁/h鲁)',
-          axisLabel: {
-            formatter: '{value}',
-            textStyle: {
-              color: '#fff' // 鍧愭爣鐨勫瓧浣撻鑹�
-            }
-          },
-          axisPointer: {
-            snap: true // 鑷姩鍚搁檮鏈�杩戠殑鐐�
-          },
-          splitLine: {
-            show: false // y杞� 缃戞牸绾夸笉鏄剧ず
-          },
-          axisLine: {
-            lineStyle: {
-              color: '#ffffff', // 鍧愭爣杞寸殑棰滆壊
-              width: 1
-            }
-          }
-        }],
-        series: [
-          {
-            name: 'COD',
-            type: 'line',
-            stack: '鎬婚噺',
-            data: dataValue1,
-            yAxisIndex: 0
-          },
-          {
-            name: '姘ㄦ爱',
-            type: 'line',
-            stack: '鎬婚噺',
-            data: dataValue2,
-            yAxisIndex: 0
-          },
-          {
-            name: '搴熸按娴侀噺',
-            type: 'line',
-            stack: '鎬婚噺',
-            data: dataValue3,
-            yAxisIndex: 1
-          }
-        ]
-      }
-      return options
     }
-  },
-  mounted () {
-    this.$nextTick(() => {
-      this.drawChart()
-      const dataWatch = JSON.parse(JSON.stringify(this.$attrs.getQueryOnlineMonData)).reverse()
-      console.log(dataWatch)
-      var dataValue1 = []
-      var dataValue2 = []
-      var dataValue3 = []
-      var dataDate = []
-      for (var i = 0; i < 24; i++) {
-        dataDate.push(dataWatch[i].MonTimeStr.substring(9))
-      }
-      for (var n = 0; n < dataWatch.length; n++) {
-        if (dataWatch[n].PoltmtrlName === 'COD') {
-          dataValue1.push(dataWatch[n].MonQty)
-        } else if (dataWatch[n].PoltmtrlName === '姘ㄦ爱') {
-          dataValue2.push(dataWatch[n].MonQty)
-        } else if (dataWatch[n].PoltmtrlName === '搴熸按娴侀噺') {
-          dataValue3.push(dataWatch[n].MonQty)
-        }
-      }
-      const opitons = this.initOptions(dataDate, dataValue1, dataValue2, dataValue3)
-      this.myChart = this.$echarts.init(this.$refs.main)
-      this.myChart.setOption(opitons)
-    })
+
   }
+
 }
 </script>
 

--
Gitblit v1.8.0