This is an automated email from the ASF dual-hosted git repository. michellet pushed a commit to branch 0.30 in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
commit 6b5a25a38540af4954e154d9c4fb14a17203b2d3 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 (cherry picked from commit fe0f5e968e8ad42dcc24c13f9aef0d3c58226d37) --- 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 5fbfed0..1a72303 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 () {
