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

timeCat scale 在 attribute 回调中,返回数值而不是时间字符串 #3367

Closed
1 task
visiky opened this issue Apr 11, 2021 · 1 comment
Closed
1 task
Assignees

Comments

@visiky
Copy link
Member

visiky commented Apr 11, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

https://riddle.alibaba-inc.com/riddles/f8938015

Steps to reproduce

https://riddle.alibaba-inc.com/riddles/f8938015

image image
Environment Info
g2 4.1.13
System -
Browser -
@pearmini pearmini changed the title time scale 在 shape 通道回调中,返回数值而不是时间字符串 timeCat scale 在 shape 通道回调中,返回数值而不是时间字符串 May 13, 2021
@pearmini pearmini changed the title timeCat scale 在 shape 通道回调中,返回数值而不是时间字符串 timeCat scale 在 attribute 回调中,返回数值而不是时间字符串 May 13, 2021
@pearmini
Copy link
Member

  • 如果设置 scale 为 time 和 cat 是没有问题的,所有回调中返回的是字符串,当前场景没有问题。
  • 当不设置 scale 的时候,默认是 timeCat,在 attribute(color、shape...)回调中返回的时间戳,因为这里回调中的数据是经过比例尺处理的,当前场景下会有问题。在 style 回调返回的是字符串,因为这里使用的是 originData。

这个问题应该是底层 scale v.0.3.x 的 bug,在处理 timeCat 的 values 的时候,直接把原来的 values 全部转化成了时间戳。

截屏2021-05-13 下午2 13 24

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

No branches or pull requests

2 participants