echarts--仪表盘

 全部代码

option = {
 series: [
                {
                  type: "gauge",
                  center: ["50%", "55%"],
                  radius: "75%",
                  min: 0,
                  max: 100,
                  splitNumber: 4, // 分割线个数(除原点外)
                  itemStyle: {
                    shadowColor: "rgba(255, 255, 255, 0.2)", // 加白色阴影产生高亮效果
                    shadowBlur: 10,
                    color:
                    {
                          //图形渐变颜色方法,四个数字分别代表,右,下,左,上,offset表示0%到100%
                          type: "linear",
                          x: 0.2,
                          y: 0,
                          x2: 1, //从左到右 0-1
                          y2: 0,
                          colorStops: [
                            {
                              offset: 0,
                              color: "#FFE329", // 0% 处的颜色
                            },
                            {
                              offset: 1,
                              color: "#49EF81", // 100% 处的颜色
                            },
                          ],
                          globalCoord: false, // 缺省为 false
                        },
                  },
                  // 进度条
                  progress: {
                    show: true,
                    width: 5,
                    roundCap: true, //圆角
                  },
                  // 仪表盘指针
                  pointer: {
                    show: false,
                  },
                  // 坐标轴线
                  axisLine: {
                    show: true,
                    color: "#3A4569",
                    roundCap: true, //圆角
                    lineStyle: {
                      width: 5,
                      color: [[1, "#374266"]],
                    },
                  },
                  // 刻度
                  axisTick: {
                    distance: -22,
                    splitNumber: 10,
                    lineStyle: {
                      width: 1,
                      color: "#325BF1",
                    },
                  },
                  // 分隔线
                  splitLine: {
                    distance: -27,
                    length: 5,
                    lineStyle: {
                      width: 1,
                      color: "#325BF1",
                    },
                  },
                  // 刻度标签(0/25/50/75/100)
                  axisLabel: {
                    distance: 13,
                    color: "#F2F2F3",
                    fontSize: 8,
                  },
                  // 表盘中指针的固定点。
                  anchor: {
                    show: false,
                  },
                  //标题
                  title: {
                    offsetCenter: [0, "40%"],
                    fontSize: 12,
                    textStyle: {
                      color: "#fff",
                    },
                  },
                  detail: {
                    valueAnimation: true,
                    lineHeight: 30,
                    borderRadius: 8,
                    offsetCenter: [0, "-10%"],
                    color: "#2790FD",
                    fontSize: 15,
                    formatter: "{value}%",
                  },
                  data: [
                    {
                      value: 55.15,
                      name:'合理'
                    },
                  ],
                },
              ],
};

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值