whycwx
2021-03-17 821657aa6644bbd5df3bc5742220fa4b624e6630
调试中国地图
2个文件已修改
1个文件已添加
46 ■■■■ 已修改文件
src/assets/images/chinaMap.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/charts/persons/wangxuan.js 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/charts/chinaMap.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/images/chinaMap.png
src/assets/js/charts/persons/wangxuan.js
@@ -41,19 +41,19 @@
        setData:{}
    }
},
// {
//     img: require("@/assets/images/monomerVoltage.png"),
//     chartData: {
//         name: '地图',
//         id: 14,
//         w: 0.635,
//         h: 0.35,
//         x: 0.35,
//         y: 0.35,
//         type: 'chinaMap',
//         setData:{}
//     }
// },
{
    img: require("@/assets/images/chinaMap.png"),
    chartData: {
        name: '地图',
        id: 14,
        w: 0.635,
        h: 0.35,
        x: 0.35,
        y: 0.35,
        type: 'chinaMap',
        setData:{}
    }
},
]
export default {
    modularTitle,
src/components/charts/chinaMap.vue
@@ -318,23 +318,27 @@
            },
            series: series
    };
        this.setOption(option);
        this.$nextTick(function(){
            this.setOption(option);
        })
    },
    resize() {
        let self = this;
        setTimeout(() => {
          self.$options.chart.resize();
          self.setData(null);
            self.$options.chart.resize();
            self.setData(null);
        }, 300)
    //   this.$options.chart.resize();
    }
  },
  mounted() {
    // 基于准备好的dom,初始化echarts实例
    this.$options.chart = echarts.init(this.$refs.chinaMap);
    window.addEventListener('resize', this.resize);
      this.$nextTick(function(){
          // 基于准备好的dom,初始化echarts实例
            this.$options.chart = echarts.init(this.$refs.chinaMap);
            window.addEventListener('resize', this.resize);
      })
  },
  destroyed() {
    window.removeEventListener('resize', this.resize);