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】关于条形图,时间区间导致图表消失问题,版本 4.0.12 #2668

Closed
logic-cn opened this issue Jul 18, 2020 · 2 comments
Labels

Comments

@logic-cn
Copy link

logic-cn commented Jul 18, 2020

  • G2 Version: 4.0.12
  • Platform: windows 10

工作中恰好用到了这个图表,遇到了这个很奇怪的问题,排查后发现,因为时间区间不同,会导致图表消失,不知道
是否为BUG,还是图表本身有什么限制?特此请教一下各位大佬。
使用的图表为官方文档示例中,图表示例 -> 条形图 -> 基础条形图 第三个,左边是 task,上面是 range 时间区间的图表
示例地址:https://g2.antv.vision/zh/examples/bar/basic#time-bar
注:为了排除自身代码问题,之后我去官网示例中,修改对应示例的数据为以下第二组中的时间区间,图表也同样消失。
两组测试数据如下:
第一组,图表可正常显示:

const data = [
      {
        "color": "#68bc00",
        "task": "task1",
        "startTime": "2020-07-15 18:32:41",
        "endTime": "2020-07-31 18:32:41",
      },
      {
        "color": "#d33115",
        "task": "task2",
        "startTime": "2020-06-15 18:23:02",
        "endTime": "2020-07-17 18:23:02",
      },
];

第二组,将以上数据中,第二条中的 startTime 修改为 2020-06-14 18:23:02 时,图表消失

const data = [
      {
        "color": "#68bc00",
        "task": "task1",
        "startTime": "2020-07-15 18:32:41",
        "endTime": "2020-07-31 18:32:41",
      },
      {
        "color": "#d33115",
        "task": "task2",
        "startTime": "2020-06-14 18:23:02",
        "endTime": "2020-07-17 18:23:02",
      },
];
@logic-cn
Copy link
Author

最新测试情况:以上数据,在官网 3.X 版本的 文档示例中,可正常显示,切换到 4.X 版本不显示。

@hustcc
Copy link
Member

hustcc commented Jan 29, 2021

使用最新的 4.1.x 应该已经处理了。底层 scale 问题,最近会进行替换为 d3-scale 提升稳定性。

@hustcc hustcc added the Scale label Jan 29, 2021
@hustcc hustcc closed this as completed Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants