Skip to content
This repository has been archived by the owner on Dec 10, 2021. 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 committed Apr 8, 2019
1 parent c3a3536 commit eaa2425
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 eaa2425

Please sign in to comment.