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

Scatter Plot X-axis is unreadable #17585

Closed
timhallinflux opened this issue Apr 2, 2020 · 1 comment · Fixed by #17692
Closed

Scatter Plot X-axis is unreadable #17585

timhallinflux opened this issue Apr 2, 2020 · 1 comment · Fixed by #17692

Comments

@timhallinflux
Copy link
Contributor

I've got a scatter plot which uses days as the x-axis (starting from day 0). However, the x-axis has no controls over how many "ticks" to display. There is no data in the (x.5) day tick, yet these are being displayed and the number of x-axis "ticks" essentially make it unreadable as a result.
scatter-dash

In the query builder/script editor mode, the x-axis is readable, but somehow this doesn't translate to the dashboard once saved.

scatter-config

@TCL735
Copy link
Contributor

TCL735 commented Apr 8, 2020

The spacing between ticks made an assumption that _time would always be on the horizontal axis and _value would always be on the vertical axis. In practice, either axis can be _time or _value or even both.

The spacing between ticks is subject to design considerations. So, the ultimate solution would be a feature request to allow the user to control the tick generation: allow both the step (difference between each tick) and also the number of ticks marked on the axes.

For now, as a default, we will apply minimum spacing with these rules:

  • when there are less than 4 ticks:
    for each tick, spacing is one-quarter of the length of a tick
    thusly: 0.25, 0.50, 0.75 of a tick's length as spacing for 1, 2, and 3 ticks respectively
  • when there are 4 to 10 ticks:
    sum of all tick lengths is shorter than total available space by at least one tick's length
  • when there are more than 10 ticks:
    for every group of up to 10 ticks there is spacing equal at least 1 tick's length
  • length of a tick is:
    vertically: average of the height and width of a span that wraps the formatted last tick in the range
    horizontally: the width of a span that wraps the formatted last tick in the range
  • additionally, vertical spacing has a limit of 5 times the height of a span that wraps the the formatted last tick in the range

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

Successfully merging a pull request may close this issue.

3 participants