目录
- 1.问题描述:
- 2.解决方法:
- 2.1第一步
- 2.2第二步
- 2.2效果
 
- 小结:
1.问题描述:
echart图片不显示
图片:
 

2.解决方法:
2.1第一步
给wxml中的ec-canvas组件添加宽高样式:style="width: 100%; height: 500px;"
原本代码:
<view class="container">
  <ec-canvas id="mychart-dom-graph" canvas-id="mychart-graph" ec="{{ ec }}"></ec-canvas>
</view>
修改后代码:
<view class="container">
  <ec-canvas id="mychart-dom-graph" style="width: 100%; height: 500px;" canvas-id="mychart-graph" ec="{{ ec }}"></ec-canvas>
</view>
2.2第二步
给wxss外层容器添加以下样式:
.container {
   position: absolute;
   top: 0;
   bottom: 0;
   left: 0;
   right: 0;
  
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: space-between;
   box-sizing: border-box;
 } 
2.2效果

小结:
 关注我给大家分享更多有趣的知识,以下是个人公众号,提供 ||代码兼职|| ||代码问题求解||
  添加我的公众号即可:



















