Skip to content

[Bug]: tick collapsed when value is 0 in Gauge #3063

@alexsbolduin

Description

@alexsbolduin

Describe the bug / 问题描述

When I use the value 0, everything ticks, and the entire graph collapses into one point.

Image

Reproduction link / 复现链接

No response

Steps to Reproduce the Bug or Issue / 重现步骤

import React from "react";
import { Gauge as GaugeAnt, GaugeConfig } from "@ant-design/plots";

export const Gauge = () => {
  const config: GaugeConfig = {
    data: {
      percent: 0
    },
    axis: {
      y: {
        tickMethod: () => [0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1]
      }
    },
    style: {
      textContent: () => "value: 0"
    }
  };
  return <GaugeAnt {...config} />;
};

Version / 版本

Please select / 请选择

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Something isn't workingplots统计图表G2

    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