whyczyk
2021-03-04 c84d328cb6448786aee00f1b0684aaa07186e410
src/components/charts/imgPieChart.vue
@@ -8,8 +8,10 @@
<script>
  import * as echarts from 'echarts';
  //引入提示框
  import "echarts/lib/component/tooltip";
  //引入chart字体自适应
  import {
    chartFontsize
  } from '@/assets/js/chartFontsize'
  const pieImg = require('../../assets/images/rectifier-img.png');
  export default {
    name: "imgPieChart",
@@ -32,7 +34,7 @@
        this.$options.chart.setOption(opt);
      },
      setData(sendData) {
        this.$options.chartData = sendData
        this.$options.chartData = sendData;
        let imgWidth = this.$refs.chart.clientWidth * 0.14;
        let imgheight = imgWidth / 0.82;
        let centerx = this.$refs.chart.clientWidth / 2;
@@ -79,16 +81,16 @@
                rich: {
                  yellow: {
                    color: "#f67f21",
                    fontSize: 16,
                    fontSize: chartFontsize(16),
                    fontWeight: '600',
                    padding: [4, 0, 0, 0],
                    padding: [chartFontsize(4), 0, 0, 0],
                    align: 'center'
                  },
                  white: {
                    color: "#ffffff",
                    align: 'center',
                    fontSize: 12,
                    padding: 4
                    fontSize: chartFontsize(12),
                    padding: chartFontsize(4)
                  },
                  hr: {
                    borderColor: '#007ed3',
@@ -171,7 +173,7 @@
      },
      resize() {
        this.$options.chart.resize();
        this.setData(this.$options.chartData)
        this.setData(this.$options.chartData);
      }
    },
    mounted() {