src/views/cockpitPage/components/MachineStartupRate.vue
@@ -8,7 +8,7 @@
          <span class="top-rate">{{ startupRate + "%" }}</span>
        </div>
      </div>
      <div class="chart" ref="chart"></div>
      <div id="main" class="chart" ref="chart"></div>
    </div>
  </div>
</template>
@@ -40,6 +40,8 @@
      }
      myChart = echarts.init(chartDom);
      let img = "/cockpitPage/machine-chart-bg.png";
      let height = myChart.getHeight() / 1;
      let width = height + 5;
      let option;
      if (data) {
        option = {
@@ -52,11 +54,10 @@
              {
                type: "image",
                z: 5,
                right: 25,
                style: {
                  image: img,
                  width: 240,
                  height: 245,
                  width: width,
                  height: height,
                  opacity: 0.55,
                },
                left: "center",
@@ -112,6 +113,20 @@
        };
        option && myChart.setOption(option);
        // window.addEventListener("resize", function () {
        //   // var chart = echarts.getInstanceByDom(document.getElementById("main"));
        //   let width = myChart.getWidth();
        //   let height = myChart.getHeight();
        //   console.log(width, height, "sssssssssss");
        //   let logo = myChart.getOption().graphic[0].elements[0];
        //   console.log(logo, "fffff");
        //   logo.style.width = width / 2;
        //   logo.style.height = height / 2;
        //   myChart.setOption({
        //     graphic: [logo],
        //   });
        //   myChart.resize();
        // });
      } else {
        option = {};
        myChart.setOption(option, true);