Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Commit

Permalink
fix: y-axis bounds for stacked viz types (#45)
Browse files Browse the repository at this point in the history
* fix: y-axis bounds for stacked viz types

* fix: add dist_bar
  • Loading branch information
khtruong authored Apr 8, 2019
1 parent 3ddaa54 commit 0f8b504
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/superset-ui-legacy-preset-chart-nvd3/src/NVD3Vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,13 @@ function nvd3Vis(element, props) {
yMin = min;
yMax = max;
} else {
const [trueMin, trueMax] = computeYDomain(data);
let [trueMin, trueMax] = [0, 1];
// These viz types can be stacked
if (isVizTypes(['area', 'bar', 'dist_bar'])) {
[trueMin, trueMax] = chart.yAxis.scale().domain();
} else {
[trueMin, trueMax] = computeYDomain(data);
}
yMin = hasCustomMin ? min : trueMin;
yMax = hasCustomMax ? max : trueMax;
}
Expand Down

0 comments on commit 0f8b504

Please sign in to comment.