Skip to content

Commit

Permalink
Apply stretchMargin only to distribution bar (#1124)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
vera-liu committed Sep 16, 2016
1 parent 3602d94 commit ffe6fb8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions caravel/assets/visualizations/nvd3_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
Expand Down

0 comments on commit ffe6fb8

Please sign in to comment.