From 823555e07db883c7d59ea4e867cca3efb784c721 Mon Sep 17 00:00:00 2001 From: Krist Wongsuphasawat Date: Wed, 6 Feb 2019 21:28:30 -0800 Subject: [PATCH] Fix line chart overflowing the right side (#6829) * Fix line chart overflowing the right side * revert package-lock.json * revert again --- superset/assets/src/visualizations/nvd3/NVD3Vis.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/superset/assets/src/visualizations/nvd3/NVD3Vis.js b/superset/assets/src/visualizations/nvd3/NVD3Vis.js index d2c3ea6d30896..062906e5f328a 100644 --- a/superset/assets/src/visualizations/nvd3/NVD3Vis.js +++ b/superset/assets/src/visualizations/nvd3/NVD3Vis.js @@ -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'])) {