const myChartContainer = document.getElementById( id ); const resizeMyChartContainer = function () { myChartContainer.style.width = ( window.innerWidt ...
const myChartContainer = document.getElementById( id ); const resizeMyChartContainer = function () { myChartContainer.style.width = ( window.innerWidth - 100 ) + 'px'; }; resizeMyChartContainer(); const myChart = echarts.init( myChartContainer ); myChart.setOption( option ); window.onresize = function () { resizeMyChartContainer(); myChart.resize(); };