0๐
//htmlPart yourEchartUsingElement
<div ref="myEchart"></div>
//JS Part this.optionCompleted is your echartData
var myChartCompleted = this.$echarts.init(this.$refs.myEchart);
myChartCompleted.setOption(this.optionCompleted)
myChartCompleted._dom.childNodes[0].childNodes[0].style.height="29rem"
myChartCompleted._dom.childNodes[0].childNodes[0].style.width="166.4rem"
You can use this method to get the DOM node of the canvas used by echarts and assign values to its properties. Every time the window changes, you execute these lines of code to re-render echarts (Google Translate)
- [Vuejs]-Vue "Is not a function" problem in my todolist app
- [Vuejs]-Trying to make equal height elements in Vue 3 / TypeScript / Quasar but it doesn't always work
Source:stackexchange.com