echars 圆圈刻度百分比

0 篇文章 0 订阅

效果如下:
效果图

export scale= (number, text) => {
  let option = {
    title: {
      x: "center",
      y: "60%",
      bottom: 50,
      text: number + '%' + text,
      textStyle: {
        fontWeight: "bold",
        fontSize: 12,
        color: "#0D252C",
        textDecoration: 'underline'
      },
    },
    series: [
      {
        splitNumber: 50,
        axisTick: false,
        axisLabel: false,
        axisLine: {
          lineStyle: {
            color: [[0, "#fff"], [1, "#fff"]],
            width: 15
          }
        },
        splitLine: {
          length: 15,
          lineStyle: {
            color: "#fff"
          }
        },
        pointer: {
          show: false,
          length: "90%",
          width: 0
        },
        detail: {
          formatter: "{value}%",
          color: "#0D252C",
          offsetCenter: [0, 0],
          fontSize: 32,
          borderBottom: "1 solid #0D252C",
          fontFamily: "Impact"
        },
        type: "gauge",
        data: [
          {
            value: number,
            name: ""
          }
        ]
      }
    ]
  }
  return option
}
<div id="gaugeContainer" style="width:200px; height:178px"></div>
mounted(){
let myChart = echarts.init(document.getElementById("gaugeContainer"));
    let option = scale(97, "可注册");
    myChart.setOption(option);
    option.series[0].axisLine.lineStyle.color = [
      [0.97, "#0D252C"],
      [1, "#198D89"]
    ];
    myChart.setOption(option);
}
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值