superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From christ...@apache.org
Subject [incubator-superset] branch release--0.31 updated: Fix line chart overflowing the right side (#6829)
Date Fri, 08 Feb 2019 23:01:43 GMT
This is an automated email from the ASF dual-hosted git repository.

christine pushed a commit to branch release--0.31
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/release--0.31 by this push:
     new 7effbb0d Fix line chart overflowing the right side (#6829)
7effbb0d is described below

commit 7effbb0d5a0b89222555bb57db2151e0edb791f4
Author: Krist Wongsuphasawat <krist.wongz@gmail.com>
AuthorDate: Wed Feb 6 21:28:30 2019 -0800

    Fix line chart overflowing the right side (#6829)
    
    * Fix line chart overflowing the right side
    
    * revert package-lock.json
    
    * revert again
    
    (cherry picked from commit 823555e07db883c7d59ea4e867cca3efb784c721)
---
 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 d2c3ea6..062906e 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'])) {


Mime
View raw message