1
huangxiaoqiang
2025-04-25 c467a598f23fd81cf624e0abc5f012fb5c9c6ada
CodeManagement/BigScreenVue/src/components/echart/index.vue
文件名从 CodeManagement/BigScreenVue/src/common/echart/index.vue 修改
@@ -1,11 +1,16 @@
<!--
 * @Author: daidai
 * @Date: 2022-02-28 16:29:08
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-09-27 15:05:45
 * @FilePath: \web-pc\src\pages\big-screen\components\echart\index.vue
-->
<template>
  <div :id="id" :class="className" :style="{ height: height, width: width }" />
</template>
<script>
import tdTheme from './theme.json' // 寮曞叆榛樿涓婚
import '../map/fujian.js'
import * as echarts from 'echarts';
export default {
  name: 'echart',
  props: {
@@ -23,7 +28,7 @@
    },
    height: {
      type: String,
      default: '2.5rem'
      default: '100%'
    },
    options: {
      type: Object,
@@ -45,7 +50,6 @@
    }
  },
  mounted () {
    this.$echarts.registerTheme('tdTheme', tdTheme); // 瑕嗙洊榛樿涓婚
    this.initChart();
  },
  beforeDestroy () {
@@ -55,7 +59,7 @@
  methods: {
    initChart () {
      // 鍒濆鍖杄chart
      this.chart = this.$echarts.init(this.$el, 'tdTheme')
      this.chart = echarts.init(this.$el)
      this.chart.setOption(this.options, true)
    }
  }