Fix line chart overflowing the right side (#6829)

* Fix line chart overflowing the right side

* revert package-lock.json

* revert again
This commit is contained in:
Krist Wongsuphasawat 2019-02-06 21:28:30 -08:00 committed by GitHub
parent 231d826757
commit 823555e07d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -641,15 +641,15 @@ function nvd3Vis(element, props) {
// If x bounds are shown, we need a right margin
margins.right = Math.max(20, maxXAxisLabelHeight / 2) + marginPad;
}
if (staggerLabels) {
margins.bottom = 40;
} else {
if (xLabelRotation === 45) {
margins.bottom = (
maxXAxisLabelHeight * Math.sin(Math.PI * xLabelRotation / 180)
) + marginPad;
margins.right = (
maxXAxisLabelHeight * Math.cos(Math.PI * xLabelRotation / 180)
) + marginPad;
} else if (staggerLabels) {
margins.bottom = 40;
}
if (isVizTypes(['dual_line', 'line_multi'])) {