Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛[BUG] Can someone explain to me how to get rid of the 12-04-2024 #2498

Open
dejongyeong opened this issue Apr 12, 2024 · 0 comments
Open

Comments

@dejongyeong
Copy link

🐛 bug 描述 [详细地描述 bug,让大家都能理解]

image

📷 复现步骤 [清晰描述复现步骤,让别人也能看到问题]

  const config: LineConfig = {
    data: {
      value: data,
      transform: [
        {
          type: "fold",
          fields: fields,
          key: "category",
          value: "value",
        },
      ],
    },
    autoFit: true,
    xField: (d: any): Date => moment(d.dt).toDate(),
    yField: "value",
    colorField: "category",
    axis: {
      x: {
        title: "Timestamp",
        type: "time",
        labelFormatter: (d: Date) =>
          moment(d).format("DD-MM-YYYY HH:mm:ss").split(" ").join("\n"),
        tickDirection: "positive",
        labelAlign: "horizontal",
        labelSpacing: 10,
        labelAutoRotate: false,
        tick: true,
      },
      y: { title: title },
    },
    tooltip: {
      title: {
        field: "dt",
        valueFormatter: (d: Date) => moment(d).format("DD-MM-YYYY HH:mm:ss"),
      },
      items: [
        {
          channel: "y",
          valueFormatter: (d: number) => d?.toFixed(2),
        },
      ],
    },
    legend: { layout: "flex", size: false },
    slider: {
      x: {
        labelFormatter: (d: Date) => moment(d).format("DD-MM-YYYY HH:mm:ss"),
      },
      y: false,
    },
    scale: {
      x: {
        type: "point",
        unknown: undefined,
      },
    },
    connectNulls: false,
  };

🏞 期望结果 [描述你原本期望看到的结果]

12-04-2024 should not be in the chart.

© 版本信息

  • ant-design-charts 版本: 2.1.12
  • 浏览器环境 Chrome
  • 开发环境 Windows 11

🚑 其他信息 [如截图等其他信息可以贴在这里]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant