微信小程序 ECharts 水球图

效果图:在这里插入图片描述

水球图插件 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
  • 5
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值