首页 前端知识 echarts 半圆进度球

echarts 半圆进度球

2024-02-11 10:02:49 前端知识 前端哥 954 768 我要收藏

在这里插入图片描述

const value = 79;
const meterOption = ref({
  title: [
    {
      text: value+'%',
      subtext:'体温指数',
      y: "38%",
      x: "center",
      textStyle: {
        fontSize: 27,
        fontFamily: 'PangMenZhengDao-Regular, PangMenZhengDao',
        color: "#ffffff",
      },
      subtextStyle: {
        fontSize: 14,
        color: "#ffffff",
      },
    },
  ],
  series: [
  {
    type: "pie",
    color: ["transparent", 'transparent','transparent'],
    startAngle: 180,
    center: ["50%", "70%"],
    radius: ['115%', '130%'],
    hoverAnimation: false,
    labelLine: {
      show: false
    },
    data: [
      {
        name: "外圈渐层",
        value: value,
        itemStyle: {
          normal: {
            show: true,
            color: new echarts.graphic.LinearGradient(0,0,1,0,[
              {
                offset: 0,
                color: "rgba(19, 42, 90, 0.4)",
              },
              {
                offset: 1,
                color: "rgba(1, 171, 243, 0.9)",
              },
            ],false),
          },
        },
      },
      { //圆球
        name: "",
        value: 5,
        label: {
          rotate: 90,
          position: 'inside',
          width: 10,
          height: 10,
          backgroundColor: '#fff',
          borderRadius: 10,
          borderWidth: 4,
          borderColor: 'rgba(11, 189, 244, 0.89)',
          shadowColor: 'rgba(11, 189, 244, 0.89)',
          shadowBlur: 4,
          shadowOffsetY: 2
        },
      }, 
      { //画剩余的刻度圆环
        name: "",
        value: 100 - value,
        itemStyle: {
            color: 'rgba(1, 171, 243, 0.20)'
        },
      }, 
      { //画剩余的刻度圆环
        name: "",
        value: 100,
      }
    ]
    }
  ]
})
转载请注明出处或者链接地址:https://www.qianduange.cn//article/1744.html
标签
评论
发布的文章

Jquery-day01

2024-02-25 11:02:14

Jquery的基本认识

2024-02-25 11:02:11

浏览器调用摄像头

2024-02-25 11:02:09

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!