Skip to content

Commit

Permalink
Avoid resetting margin to 0 (apache#6536)
Browse files Browse the repository at this point in the history
* Avoid resetting margin to 0

* Fixing margin for pie chart

(cherry picked from commit 7f0ff8c)
  • Loading branch information
michellethomas committed Dec 18, 2018
1 parent a3ad6d1 commit e5b4156
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions superset/assets/src/visualizations/nvd3/NVD3Vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -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 () {
Expand Down

0 comments on commit e5b4156

Please sign in to comment.