Skip to content

Commit

Permalink
don't reset y scales just for elasticity
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonwoodhull committed Aug 6, 2015
1 parent 9ccf415 commit 9b4242a
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 16 deletions.
13 changes: 10 additions & 3 deletions dc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dc.js.map

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions dc.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dc.min.js.map

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions src/composite-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ dc.compositeChart = function (parent, chartGroup) {

function prepareRightYAxis() {
if (_chart.rightY() === undefined || _chart.elasticY()) {
_chart.rightY(d3.scale.linear());
if (_chart.rightY() === undefined) {
_chart.rightY(d3.scale.linear());
}
_chart.rightY().domain([rightYAxisMin(), rightYAxisMax()]).rangeRound([_chart.yAxisHeight(), 0]);
}

Expand All @@ -125,7 +127,9 @@ dc.compositeChart = function (parent, chartGroup) {

function prepareLeftYAxis() {
if (_chart.y() === undefined || _chart.elasticY()) {
_chart.y(d3.scale.linear());
if (_chart.y() === undefined) {
_chart.y(d3.scale.linear());
}
_chart.y().domain([yAxisMin(), yAxisMax()]).rangeRound([_chart.yAxisHeight(), 0]);
}

Expand Down Expand Up @@ -315,6 +319,7 @@ dc.compositeChart = function (parent, chartGroup) {
return _rightY;
}
_rightY = _;
_chart.rescale();
return _chart;
};

Expand Down
4 changes: 3 additions & 1 deletion src/coordinate-grid-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,9 @@ dc.coordinateGridMixin = function (_chart) {

_chart._prepareYAxis = function (g) {
if (_y === undefined || _chart.elasticY()) {
_y = d3.scale.linear();
if (_y === undefined) {
_y = d3.scale.linear();
}
var min = _chart.yAxisMin() || 0,
max = _chart.yAxisMax() || 0;
_y.domain([min, max]).rangeRound([_chart.yAxisHeight(), 0]);
Expand Down
9 changes: 7 additions & 2 deletions web/js/dc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion web/js/dc.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions web/js/dc.min.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion web/js/dc.min.js.map

Large diffs are not rendered by default.

0 comments on commit 9b4242a

Please sign in to comment.