Closes #387: Only truncate 'category' type labels.#390
Merged
Conversation
|
@emtwo I don't know how to create a graph with what options to reproduce the bug with your test data, do you mind sharing how you set it up locally? |
Author
|
Sure. Overlapping labels bug:
Date formatting bug:
|
|
For the record, theses are the graphs how they look like in both of the cases @emtwo mentioned in the previous comment: And here with the patch applied: |
jezdez
approved these changes
May 2, 2018
jezdez
left a comment
There was a problem hiding this comment.
This looks great, was able to reproduce and it fixed those two cases of misbehaving labels.
👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




This is a follow-up from #374 which unfortunately caused #387
I'm learning that using Plotly correctly is in fact wizardry.
It turns out that
ticktextoverrides any nice x-axis formatting that Plotly does by default such as avoiding overlapping labels. So this patch removes the use ofticktext.Furthermore, stringifying and/or truncating axis types such as
datetimealso affects the pretty Plotly formatting. Since the string truncation issue originally reported in #359 was only for thecategorytype, I think it's safe/best to limit to that in this patch.The test cases in #378 should apply to this patch. Additionally, here is a test case that triggers #387. It did not work with the
datetimeaxis type and also had overlapping x-axis values when usingcategory. Both of these should now be resolved.