派生自 wuyushui/SewerAndRainNetwork

wangqi
2021-04-09 8b8e83df0b3b5323ceaf3f8a8f1f91d21bdccd87
src/components/BaseNav/PublicBounced/GasComponents/EChartsHour.vue
@@ -309,26 +309,26 @@
      return options
    }
  },
  methods: {
    onSubmit () {
      console.log('submit!')
    },
    drawChart: function () {
      const myChart = this.$echarts.init(this.$refs.main)
      myChart.setOption(this.options)
      window.onresize = function () {
        var h1 = document.documentElement.clientHeight// 获取屏幕的高度
        if (h1 > 700) {
          myChart.getDom().style.height = 3 + 'rem'
          myChart.getDom().style.width = 6 + 'rem'
        } else {
          myChart.getDom().style.height = 3 + 'rem'
          myChart.getDom().style.width = 6 + 'rem'
        }
        myChart.resize()
      }
    }
  },
  // methods: {
  //   // onSubmit () {
  //   //   console.log('submit!')
  //   // },
  //   drawChart: function () {
  //     const myChart = this.$echarts.init(this.$refs.main)
  //     myChart.setOption(this.options)
  //     window.onresize = function () {
  //       var h1 = document.documentElement.clientHeight// 获取屏幕的高度
  //       if (h1 > 700) {
  //         myChart.getDom().style.height = 3 + 'rem'
  //         myChart.getDom().style.width = 6 + 'rem'
  //       } else {
  //         myChart.getDom().style.height = 3 + 'rem'
  //         myChart.getDom().style.width = 6 + 'rem'
  //       }
  //       myChart.resize()
  //     }
  //   }
  // },
  mounted () {
    this.$nextTick(() => {
      this.drawChart()