| | |
| | | <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> |
| | |
| | | } |
| | | 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 = { |
| | |
| | | { |
| | | type: "image", |
| | | z: 5, |
| | | right: 25, |
| | | style: { |
| | | image: img, |
| | | width: 240, |
| | | height: 245, |
| | | width: width, |
| | | height: height, |
| | | opacity: 0.55, |
| | | }, |
| | | left: "center", |
| | |
| | | }; |
| | | |
| | | 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); |