Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2k
Increase axis autorange when bars have outside text labels#7675
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
camdecoster left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I left some syntax and refactoring comments, but this looks good.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
1ef511f toacf38e1CompareCo-authored-by: Cameron DeCoster <cameron.decoster@gmail.com>
e0c2df7 intomasterUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Closes#2001
Adds a step during bar calc to add extra padding to axis range if bar has outside text labels.
Note: The first commit in this PR is just formatting changes. Usethis diff to skip the first commit and see only the meaningful changes.
Codepen here!https://codepen.io/emilykl-code/pen/JoXQqLL
This is a stopgap fix for the fact that text labels are not taken into account during autorange calculations (see#2000).
Unfortunately, as discussed in that issue, modifying autorange to account for text labels is a significant amount of work, so I've opted for a more limited fix to address the issue identified in#2001.
Changes in this PR:
textpositionis'outside',orientationis vertical, andtextortexttemplateis provided and non-falsy, andtextangleis0or'auto'"cliponaxis": "false"from thehist_stackedimage mock, to demonstrate the effect of the changes in this PR (see below)Screenshots
Before:

After:

hist_stackedmock (withcliponaxis: falseremoved) Before:hist_stackedmock (withcliponaxis: falseremoved) After:Steps for testing
Use the following mock:
Verify that it looks like the "before" picture on
masterand the "after" picture on this branch.Other variations to test:
layout.yaxis.autorangeto"reversed"bar.textproperty instead ofbar.texttemplatelayout.barmodeto"stack"You can also load the
hist_stackedmock in the devtools as another test case.