-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Fix line chart overflowing the right side #6829
Conversation
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.
did you mean to commit the package-lock.json
?
Maybe I should update the |
if (staggerLabels) { | ||
margins.bottom = 40; | ||
} else { | ||
if (xLabelRotation === 45) { |
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.
@kristw what was the problem with the code? I thought that since xLabelRotation
and staggerLabels
are mutually exclusive we could check for stagger labels first. And if no rotation is set (ie, xLabelRotation = 0
) then lines 647-651 would have no effect since we now compute the margins based on the angle.
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.
Short ans: I changed and it fixes the issue with line chart.
Longer ans: There are other code that modify margins.right
above, which will be overridden by your else
clause.
* Fix line chart overflowing the right side * revert package-lock.json * revert again (cherry picked from commit 823555e)
* Fix line chart overflowing the right side * revert package-lock.json * revert again (cherry picked from commit 823555e)
* Fix line chart overflowing the right side * revert package-lock.json * revert again (cherry picked from commit 3f3b7bb)
Incorrect margin calculation for line chart making the content overflow right side.
Fix bug introduced by #6626
@betodealmeida @williaster @graceguo-supercat