Skip to content

[Bug] 仪表盘设置value为0时出现满圆覆盖图形 #16640

@Rachaerin

Description

@Rachaerin

Version

5.2.2

Link to Minimal Reproduction

No response

Steps to Reproduce

实现代码:

option = {
  title: {
    left: '18%',
    top: '40%',
    text: `100%`,
    textStyle: {
      fontSize: 14,
      color: '#fff',
      fontWeight: 'bold'
    }
  },
  series: [
    {
      type: 'gauge',
      startAngle: 200,
      endAngle: -20,
      radius: '100%',
      center: ['42%', '60%'],
      min: 0,
      max: 100,
      splitNumber: 12,
      itemStyle: {
        normal: {
          color: new echarts.graphic.LinearGradient(0, 1, 1, 1, [
            {
              offset: 0,
              color: '#7616F8'
            },
            {
              offset: 1,
              color: '#E222FE'
            }
          ])
        }
      },
      progress: {
        show: true,
        roundCap: true,
        width: 4
      },
      pointer: {
        show: false
      },
      axisLine: {
        roundCap: true,
        lineStyle: {
          width: 4
        }
      },
      axisTick: {
        show: false
      },
      splitLine: {
        show: false
      },
      axisLabel: {
        show: false
      },
      title: {
        show: false
      },
      detail: {
        show: false
      },
      data: [{ value: 1 }]
    },
    // 底层颜色
    {
      type: 'gauge',
      startAngle: 200,
      endAngle: -20,
      radius: '100%',
      center: ['42%', '60%'],
      axisLine: {
        roundCap: true,
        lineStyle: {
          color: [[1, '#023AFF']],
          width: 4
        }
      },
      splitLine: {
        show: false // 是否显示分隔线
      },
      axisTick: {
        show: false // 是否显示刻度
      },
      axisLabel: {
        show: false // 是否显示刻度标签
      }
    }
  ]
};

Current Behavior

当值为0时,会出现满圆形覆盖图表

Expected Behavior

在data为0时应正常显示

Environment

- OS:window
- Browser:chrome 98
- Framework: ant design pro react

Any additional comments?

#14095中曾经提到该问题,并显示修复于5.1版本,然而在5.2.x版本中还是存现该问题,并且在官网使用5.3.1还是存在该问题

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions