管道基础大数据平台系统开发-【前端】-新系統界面
1
Surpriseplus
2022-12-19 9c803f20cc05395bac2d3386accfe230210c07dc
src/components/echart44.vue
@@ -10,46 +10,49 @@
  components: {},
  data() {
    //这里存放数据
    return {};
    return { myChart };
  },
  mounted() {
    this.lineChart();
    this.$bus.$on('resizeEchart', (res) => {
      this.myChart.resize();
    });
  },
  //方法集合
  methods: {
    lineChart() {
      let option = {
        title: {
          text: "各项目总体进度",
          text: '各项目总体进度',
          textStyle: {
            color: "#fff",
            color: '#fff',
          },
        },
        tooltip: {
          trigger: "item",
          trigger: 'item',
        },
        // legend: {},
        grid: {
          left: "3%",
          right: "4%",
          bottom: "3%",
          left: '3%',
          right: '4%',
          bottom: '3%',
          containLabel: true,
        },
        series: [
          {
            name: "各项目总体进度",
            type: "pie",
            radius: ["40%", "70%"],
            roseType: "radius",
            color: ["#03effb", "#00bec4", "#3a82ab"],
            name: '各项目总体进度',
            type: 'pie',
            radius: ['40%', '70%'],
            roseType: 'radius',
            color: ['#03effb', '#00bec4', '#3a82ab'],
            avoidLabelOverlap: false,
            itemStyle: {
              fontColor: "fff",
              borderColor: "#fff",
              fontColor: 'fff',
              borderColor: '#fff',
            },
            label: {
              show: false,
              position: "center",
              position: 'center',
            },
            emphasis: {
              // label: {
@@ -61,17 +64,17 @@
              show: false,
            },
            data: [
              { value: 4, name: "已完成" },
              { value: 7, name: "进行中" },
              { value: 8, name: "未开始" },
              { value: 4, name: '已完成' },
              { value: 7, name: '进行中' },
              { value: 8, name: '未开始' },
            ],
          },
        ],
      };
      let myChart = this.$echarts.init(document.getElementById("echart44"));
      myChart.setOption(option);
      window.addEventListener("resize", function () {
        myChart.resize();
      this.myChart = this.$echarts.init(document.getElementById('echart44'));
      this.myChart.setOption(option);
      window.addEventListener('resize', function () {
        this.myChart.resize();
      });
    },
  },