echarts-仪表盘

 

const options = {
        series: [
          {
            type: "gauge",
            radius: "95%", // 仪表盘的大小,可以是像素值或者百分比
            min: 1,
            max: 3,
            splitNumber: 4, //仪表盘刻度的分割段数
            progress: { 
              show: false, //是否显示进度条
              roundCap: true,//是否在两端显示成圆形
              width: 18,//进度条宽度
            },
            //指针样式
            itemStyle: {
              color: "#34B907",
              borderColor: "#E5EDEC",
              borderWidth: 1,
            },
            // 表盘指针中间的固定点
            anchor: {
              show: true,
              showAbove: true,
              size: 15,
              itemStyle: {
                color: "#34B907",
                borderColor: "#F7F9FD;",
                borderWidth: 2,
              },
            },
            axisLine: {
              lineStyle: {
                width: 12, //仪表盘的宽度
                /* color: [ //仪表盘的颜色,不过渡
                  [0.17, "#38D949"],
                  [0.33, "#34BD0E"],
                  [0.46, "#F7BA4C"],
                  [0.49, "#FB9915"],
                  [0.74, "#FF6A51"],
                  [1, "#FF5751"],
                ], */
                color: [//仪表盘的颜色,过渡自然
                  [
                    0.3,
                    new echarts.graphic.LinearGradient(0, 1, 0, 0, [
                      {
                        offset: 0,
                        color: "#39DC4E",
                      },
                      {
                        offset: 1,
                        color: "#34BC0C",
                      },
                    ]),
                  ],
                  [
                    0.6,
                    new echarts.graphic.LinearGradient(0, 1, 0, 0, [
                      {
                        offset: 0,
                        color: "#F7BB4C",
                      },
                      {
                        offset: 1,
                        color: "#FB9711",
                      },
                    ]),
                  ],
                  [
                    1,
                    new echarts.graphic.LinearGradient(0, 1, 0, 0, [
                      {
                        offset: 0,
                        color: "#FF6A51",
                      },
                      {
                        offset: 1,
                        color: "#FF5251",
                      },
                    ]),
                  ],
                ],
              },
            },
            
            axisTick: {
              distance: 5,
              show: true,
              lineStyle: {
                color: "#fff",
              },
            },
            splitLine: {
              distance: 5,
              length: 5,
              lineStyle: {
                width: 2,
                color: "#fff",
              },
            },
            axisLabel: {
              distance: 18, //数字的距离
              color: "#fff",
              fontSize: 14,
            },
            title: {
              show: false,
            },
            detail: {
              show: false,
              fontSize: 0,
            },
            data: [
              {
                value: 1.4,
              },
            ],
          },
        ],
      };

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值