antvis/G2
The issue has been closed
【BUG】关于条形图,时间区间导致图表消失问题,版本 4.0.12 #2668
logic-cn posted onGitHub
- G2 Version: 4.0.12
- Platform: windows 10
<!-- Enter your issue details below this comment. -->
工作中恰好用到了这个图表,遇到了这个很奇怪的问题,排查后发现,因为时间区间不同,会导致图表消失,不知道 是否为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",
},
];