-
-
Notifications
You must be signed in to change notification settings - Fork 391
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
x-axis time stamps configuration #303
Comments
there's a recent breaking change coming in 1.2. see if the new format makes more sense: (read the comments above the config array in the code) axis.values is a formatting function that accepts raw splits values and returns formatted tick labels. the default temporal axis formatter is able to accept a concise config array (_timeAxisStamps) which it pre-compiles. |
Ah, I got super confused by the new format only because it's not released yet and I'm on 1.1.2:) I think it makes more sense than the current one - especially that the current one is cryptic - as I mentioned I don't know what 7 mean 4 mean in the 3rd column of the array. The new one seems more readable, but still quite cryptic unless there is a documentation. For example with this line: [s, ss, NLmdyy + " " + hmmaa, _, NLmd + " " + hmmaa, _, NLhmmaa, _, 1], It will precompile the array in timeAxisStamps, but can you guide me or explain how is the format being picked when the axis is actually rendered? Looking at the config I just don't know what to expect to be rendered. |
the formatter goes through a selection process based on the axis splits spacing. this next, it will go through a selection process of whether to render the default tick format [1] or a more detailed rollover tick format [2]-[7] which will get appended (due to [8]) to the default tick format. the first tick on the axis will always be a rollover tick because there's no prior context. the rest will track rollovers and modify which format to use dynamically based on what rolls over (year, month, day, etc...). |
Ok, this makes sense, thank you. When do you plan 1.2 release? |
there's nothing outstanding, so likely today or tomorrow. |
1.2.0 is published. |
thank you @leeoniya, this is awesome! |
@leeoniya do you mind explaining what is the 3rd column in the
values
array when customizing time formatting as described here https://github.com/leeoniya/uPlot/tree/master/docs#axis--grid-opts ?Also - what is the relation between
values
and the_timeAxisStamps
?I went through the code but there's plenty to digest there :)
The text was updated successfully, but these errors were encountered: