michellethomas closed pull request #6536: Avoid resetting margin to 0
URL: https://github.com/apache/incubator-superset/pull/6536
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/superset/assets/src/visualizations/nvd3/NVD3Vis.js 
b/superset/assets/src/visualizations/nvd3/NVD3Vis.js
index 14ba9c4f93..a31c67e3f2 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 () {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to