antvis/G2

tooltip 标题的默认格式化方式 #5684

hustcc posted onGitHub

AntV Open Source Contribution Plan(可选)

  • 我同意将这个 Issue 参与 OSCP 计划

Issue 难度

中等难度

任务介绍

当图表中 encode 的 x 为日期字段的时候,tooltip title 会默认显示 x 轴的数据,对于日期的默认格式化效果不是很友好。

image

期望有更好的默认格式化效果,自动根据数据的情况,选择是 YYMMDD 还是更细的粒度。

详细介绍

No response

参考说明


【BENcorry 认领】

posted by BENcorry over 1 year ago

方案:

  1. 判断当前tooltip options title 是否有处理
  2. 如果无处理,对当前title进行值判断是否为Date,如果不是,不做处理
  3. 如果是,动态判断当前时间值给予YYYY-MM-DD 或者是YYYY-MM-DD HH:mm:ss
posted by BENcorry over 1 year ago

@BENcorry

感谢对 G2 对贡献!欢迎加入下面的群,进一步贡献和了解更多:

<img src="https://github.com/antvis/G2/assets/49330279/fcee44fa-bc79-4f13-b1eb-12fa94164606" width=240 />

posted by pearmini over 1 year ago

Fund this Issue

$0.00
Funded

Pull requests