效果图:
水球图插件 git地址:https://github.com/ecomfe/echarts-liquidfill#api
下载后,将dist下面的echarts-liquidfill.min.js 这个文件放在小程序里面引入的echarts组件目录下
小程序页面代码
wxml代码:
<view class="top">
<view class="waterPolo">
<ec-canvas id="dispace_charts" canvas-id="dispace_charts" ec="{
{ ec_dispace_charts }}" force-use-old-canvas="true"></ec-canvas>
</view>
</view>
设置 force-use-old-canvas="true"
防止跟随父元素滑动
wxss代码:个人习惯用less写样式
.top {
display: flex;
justify-content: center;
align-items: center;
.waterPolo {
width: 200rpx;
height: 200rpx;
.waterPolo canvas {
width: 200rpx;
height