Skip to content

[Bug]: Interval 图表使用 Date 类型作为 x 轴的时候,并没有按照时间间隔进行自动分隔 #7219

@JackieLs

Description

@JackieLs

Describe the bug / 问题描述

Image 图片上面图表的是散点图,x是按时间维度进行排列的,可以自动进行时间跨度的展示。 但是下面的图表是柱状图,x轴处理为固定的跨度进行展示,当使用 scale: {x: {type: 'time'}} 的时候还会报错:scale.getBandWidth is not a function
chart.options({
      type: 'interval',
      encode: {
        x: (d) => new Date(d.rptdate),
        y: 'value',
        color: 'engloc',
      },
});

Reproduction link / 复现链接

No response

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

No response

Version / 版本

🆕 5.x

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting for maintainerTriage or intervention needed from a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions