Apply stretchMargin only to distribution bar (#1124)

* When the label size is too short, the constant for calculating
margin_size does not apply. Also nvd3 auto-adjust font-size of axis
labels.
Temporary solution here: Setting a fixed font-size on nvd3 axis labels
and a minimum threshold for label size.

* Only stretch margin for dist_bar
This commit is contained in:
vera-liu 2016-09-16 15:39:50 -07:00 committed by GitHub
parent 3602d940eb
commit ffe6fb849f
1 changed files with 6 additions and 2 deletions

View File

@ -312,8 +312,12 @@ function nvd3Vis(slice) {
}
if (fd.bottom_margin === 'auto') {
const stretchMargin = calculateStretchMargins(payload);
chart.margin({ bottom: stretchMargin });
if (vizType === 'dist_bar') {
const stretchMargin = calculateStretchMargins(payload);
chart.margin({ bottom: stretchMargin });
} else {
chart.margin({ bottom: 50 });
}
} else {
chart.margin({ bottom: fd.bottom_margin });
}