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

[vis] fix axis labels display #2066

Merged
merged 6 commits into from
Jan 31, 2017
Merged

Conversation

ascott
Copy link

@ascott ascott commented Jan 27, 2017

  • if it's a time series, rotate labels 90 (we may want to do this for all x axis labels in the future for consistency)
  • once rendered measure the length of the formatted label text and adjust margins to accommodate

fixes: #1971

before
screenshot 2017-01-26 21 23 34

after
screenshot 2017-01-26 21 14 14

before
screenshot 2017-01-26 21 22 58

after
screenshot 2017-01-26 21 13 24

plz review @airbnb/superset-reviewers

@ascott ascott force-pushed the alanna-fix-axis-ui branch from 5ede928 to 818f0db Compare January 27, 2017 19:19
@vera-liu
Copy link
Contributor

Would rotating 45 degrees make it more readable?

@ascott
Copy link
Author

ascott commented Jan 30, 2017

rotating 45 degrees makes the chart a bit smaller since we have to increase the right margin to accommodate the last label. when i look at these side by side, i think 90 degree labels work much better. @elibrumbaugh do you have any thoughts on this? @mistercrunch @vera-liu which do you think works better?

screenshot 2017-01-30 11 00 51

vs.

screenshot 2017-01-30 11 06 23

@elibrumbaugh
Copy link

Thanks for sharing this with me @ascott! From a legibility perspective, I think 45° works better than 90° here. However, the shrinking of the graph is an issue. If I had to trade off I would keep the labels 45° and allow the graph to be pushed in. One way I've seen this solved (sort of) in the past is to truncate long labels from the middle or end that are rotated 45°. For example: 1985-01-01 00:00:00 is 1985...00:00. On hover the entire label could be shown. This could also be a toggle to turn them on and off.

@ascott
Copy link
Author

ascott commented Jan 31, 2017

one other alternative, 60 degree rotation.

screenshot 2017-01-30 15 45 26

vs 45 degrees

screenshot 2017-01-30 11 00 51

@ascott
Copy link
Author

ascott commented Jan 31, 2017

sync'd with @elibrumbaugh on 60 vs 45. we will stick with 45 since it's more standard within our app and others.

@ascott ascott merged commit e169c67 into apache:master Jan 31, 2017
SalehHindi pushed a commit to SalehHindi/superset that referenced this pull request Jun 9, 2017
* re-render chart after adjusting for long axis labels

* measure all of the labels and take the max height

* add missing isTimeSeries var

* fix linting

* use jQuery to get text ticks

* rotate 45 rather than 90
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.16.0 labels Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[explore] fix axis labels on time series - line chart
4 participants