This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new fe0f5e9  Avoid resetting margin to 0 (#6536)
fe0f5e9 is described below

commit fe0f5e968e8ad42dcc24c13f9aef0d3c58226d37
Author: michellethomas <[email protected]>
AuthorDate: Fri Dec 14 14:17:45 2018 -0800

    Avoid resetting margin to 0 (#6536)
    
    * Avoid resetting margin to 0
    
    * Fixing margin for pie chart
---
 superset/assets/src/visualizations/nvd3/NVD3Vis.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/superset/assets/src/visualizations/nvd3/NVD3Vis.js 
b/superset/assets/src/visualizations/nvd3/NVD3Vis.js
index 14ba9c4..a31c67e 100644
--- a/superset/assets/src/visualizations/nvd3/NVD3Vis.js
+++ b/superset/assets/src/visualizations/nvd3/NVD3Vis.js
@@ -353,6 +353,8 @@ function nvd3Vis(element, props) {
             chart.labelType(d => `${d.data.x}: ${((d.data.y / total) * 
100).toFixed()}%`);
           }
         }
+        // Pie chart does not need top margin
+        chart.margin({ top: 0 });
         break;
 
       case 'column':
@@ -407,8 +409,8 @@ function nvd3Vis(element, props) {
       default:
         throw new Error('Unrecognized visualization for nvd3' + vizType);
     }
-    // Assuming the container has padding already
-    chart.margin({ top: 0, left: 0, right: 0, bottom: 0 });
+    // Assuming the container has padding already other than for top margin
+    chart.margin({ left: 0, right: 0, bottom: 0 });
 
     if (showBarValue) {
       setTimeout(function () {

Reply via email to