[Vuejs]-The content overflows after the echarts line chart refreshes the page

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)

Leave a comment