Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
305 views
in Technique[技术] by (71.8m points)

关于echarts的问题?

在el-tab中使用echarts
image.png
设置了宽100% 高500px,但是解析出来的话,变成了宽100px了
image.png
这该如何解决?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

图表的宽度可以在创建实例或者调用resize的时候设置

  • width

可显式指定实例宽度,单位为像素。如果传入值为 null/undefined/'auto',则表示自动取 dom(实例容器)的宽度。

    echarts.init(document.getElementById('chart'), { width: 'null', height: 500 }) // 或者不传width
    chartInstance.resize({ width: 'null', height: 500 }) // 或者不传width

创建echarts实例
改变图表尺寸


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...