Skip to content

Commit

Permalink
Fix line chart overflowing the right side (#6829)
Browse files Browse the repository at this point in the history
* Fix line chart overflowing the right side

* revert package-lock.json

* revert again
  • Loading branch information
kristw authored Feb 7, 2019
1 parent 231d826 commit 823555e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions superset/assets/src/visualizations/nvd3/NVD3Vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'])) {
Expand Down

0 comments on commit 823555e

Please sign in to comment.