antvis / antvis/G2Plot

当 Line chart xAxis data type 为 time 时引发的 bug

Open
#2,014 4 comments 0 reactions 2 assignees Claimed by @pearmini View on GitHub
Bug Scale
Dominant language
TypeScript
Stars
2.7k
Forks
591
PR merge metrics
No merged PRs in 30d

Description

### Online example

[https://codesandbox.io/s/pensive-breeze-rkxk1?fontsize=14&hidenavigation=1&theme=dark](https://codesandbox.io/s/pensive-breeze-rkxk1?fontsize=14&hidenavigation=1&theme=dark)

### Description

我准备了三种资料,当 data 有小于 1970 时会有诸多bug
1. slider 拖动时无法正常显示(xAxis max 被固定住)
2. 右边多出一堆空白时间

I prepare three kinds of time data
1. all date < 1970
2. some date < 1970
3. all date > 1970

If the date is less than 1970, the slider will be invalid and the max of xAxis will be fixed

### Why 1970?

because `Jan 01 1970 00:00:00` convert to milliseconds equal to `0`, so as long as the date less than 1970 is converted to milliseconds, it will be a negative number

### Possible root cause

In antv source code: `antv/scale/lib/continuous/time`

function `setDomain` no consideration of negative numbers

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.