Skip to content

Commit

Permalink
don't enforce #667, extents including zero, again
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonwoodhull committed Jul 19, 2016
1 parent f344129 commit 4b17376
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/composite-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,14 @@ dc.compositeChart = function (parent, chartGroup) {
}

function alignYAxisRanges (lyAxisMin, lyAxisMax, ryAxisMin, ryAxisMax) {
// make sure both ranges include zero (or there's nothing to align)
// this is already true due to the stack mixin (#667)
lyAxisMin = Math.min(lyAxisMin, 0);
ryAxisMin = Math.min(ryAxisMin, 0);
lyAxisMax = Math.max(lyAxisMax, 0);
ryAxisMax = Math.max(ryAxisMax, 0);

// since the two series will share a zero, each Y is just a multiple
// of the other. and the ratio should be the ratio of the ranges of the
// input data, so that they come out the same height. so we just min/max

// note: both ranges already include zero due to the stack mixin (#667)
// if #667 changes, we can reconsider whether we want data height or
// height from zero to be equal.
// height from zero to be equal. and it will be possible for the axes
// to be aligned but not visible.
var extentRatio = (ryAxisMax - ryAxisMin) / (lyAxisMax - lyAxisMin);

return {
Expand Down

0 comments on commit 4b17376

Please sign in to comment.