Skip to content

timebar axis labels cannot display normal time data strings 时间轴数据标签无法展现标准时间数据 #4367

Closed Answered by R4Y815
R4Y815 asked this question in Q&A
Discussion options

You must be logged in to vote

found the solution in the documentation for version 4.3.2:
https://antv-g6.gitee.io/en/docs/api/Plugins:

https://antv-g6.gitee.io/en/docs/api/Plugins#tickcfg:

and with the code example for SliceTimebar in documentation for version 4.8.7:
https://g6.antv.antgroup.com/en/examples/tool/timebar/#slice-timebar
tick: { tickLabelFormatter: (d) => { count++; const dateStr =${d.date}; if ((count - 1) % 10 === 0) { return ${dateStr.substr(0, 4)}-${dateStr.substr(4, 2)}-${dateStr.substr(6, 2)}; } return false; }, },

using tickLabelFormatter key, I was able to set the timeBar time axis data labels- this indeed offers a lot of flexibility.

Hope this will be helpful for others too!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by R4Y815
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant