js获取页面大小修改echarts图的大小


<div id="main" style="max-width: 1920px;margin: auto"></div>


var vh= window.innerHeight*0.7;
var vw= window.innerWidth*0.7;
console.log(vh);
document.getElementById('main').style.setProperty('height',vh+'px');
document.getElementById('main').style.setProperty('width',vw+'px');

猜你喜欢

转载自blog.csdn.net/weixin_45631815/article/details/116237385