Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

(x|y)axis.ticklabelmode = instant | period #4911

Closed
nicolaskruchten opened this issue Jun 10, 2020 · 1 comment · Fixed by #4993
Closed

(x|y)axis.ticklabelmode = instant | period #4911

nicolaskruchten opened this issue Jun 10, 2020 · 1 comment · Fixed by #4993
Assignees
Labels
feature something new

Comments

@nicolaskruchten
Copy link
Contributor

nicolaskruchten commented Jun 10, 2020

This issue is scoped to 2D type = date axes when there is no ticktext.

We need to add a new attribute (proposed name ticklabelmode) whose default value (instant) describes the current behaviour of our axes.

The new behaviour (period) would cause the tick label (not the tick or gridline!) to be positioned at the midpoint of the period that its current formatting represents (note: this means that it's sensitive to tickformat and tickformatstops). So for example if the ticklabel is Jan then instead of positioning it at YYYY-01-01 00:00 (the 'instant') we would position it at YYYY-01-15 12:00 (the midpoint of the 'period').

@nicolaskruchten nicolaskruchten added this to the v1.55.0 milestone Jun 10, 2020
@archmoj archmoj self-assigned this Jun 11, 2020
@nicolaskruchten nicolaskruchten removed this from the v1.55.0 milestone Jul 7, 2020
@nicolaskruchten
Copy link
Contributor Author

Here is a motivational codepen: https://codepen.io/nicolaskruchten/pen/yLeEVvw?editors=0010

When setting nticks=14 and ticklabelmode="period", the labels should be directly between the ticks: 50% right-shifted. However, when setting nticks=5 and ticklabelmode="period" the labels should be about 25% right-shifted, so as to be placed in the middle of the period that the label represents.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feature something new
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants