派生自 wuyushui/SewerAndRainNetwork

XingChuan
2021-05-30 e66121f92a663b0a22dad56aedf388fc79d67258
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<template>
  <!--  <div class="public-chart">-->
  <div style="width:800px;height:200px;" ref="publicChart"></div>
  <!--  </div>-->
</template>
 
<script>
export default {
  name: 'PublicChart',
  props: {
    propsData: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },
  data () {
    return {
      publicChart: null
    }
  },
  mounted () {
    this.$nextTick(() => {
      this.publicChart = this.$echarts.init(this.$refs.publicChart)
      this.publicChart.clear()
      this.publicChart.setOption(this.propsData)
      window.onresize = this.publicChart.resize()
    })
  },
  methods: {}
}
</script>
 
<style lang="less" scoped>
 
</style>