Skip to content

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 and zhaoyongjie committed Nov 25, 2021
1 parent fc7b46e commit aa10bec
Showing 1 changed file with 7 additions and 1 deletion.
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 aa10bec

Please sign in to comment.