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

(cherry picked from commit 823555e)
  • Loading branch information
kristw authored and Grace Guo committed Feb 8, 2019
1 parent 1aceae5 commit aad5f1c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions superset/assets/src/visualizations/nvd3/NVD3Vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,12 @@ function nvd3Vis(element, props) {
margins.right = Math.max(20, maxXAxisLabelHeight / 2) + marginPad;
}
if (xLabelRotation === 45) {
margins.bottom = maxXAxisLabelHeight + marginPad;
margins.right = maxXAxisLabelHeight + marginPad;
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;
}
Expand Down

0 comments on commit aad5f1c

Please sign in to comment.