Skip to content

Commit 62b88c9

Browse files
enable elasticX only for render, if mouseZoomable or focusChart
elasticX can reasonably be interpreteted as "just calculate the domain for me, unless it's forced by something else" so ignore it during redraw if this is a focus chart or mouseZoomable is active fixes #1623, #987
1 parent 5121ef9 commit 62b88c9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/coordinate-grid-mixin.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ dc.coordinateGridMixin = function (_chart) {
479479

480480
function prepareXAxis (g, render) {
481481
if (!_chart.isOrdinal()) {
482-
if (_chart.elasticX()) {
482+
if (_chart.elasticX() && (render || (!_chart.mouseZoomable() && !_rangeChart))) {
483483
_x.domain([_chart.xAxisMin(), _chart.xAxisMax()]);
484484
}
485485
} else { // _chart.isOrdinal()
@@ -500,6 +500,9 @@ dc.coordinateGridMixin = function (_chart) {
500500
_x.domain(_chart._ordinalXDomain());
501501
}
502502
}
503+
if(render && _chart.elasticX()) {
504+
_xOriginalDomain = _chart.x().domain();
505+
}
503506

504507
// has the domain changed?
505508
var xdom = _x.domain();
@@ -1236,7 +1239,7 @@ dc.coordinateGridMixin = function (_chart) {
12361239

12371240
_chart.plotData();
12381241

1239-
if (_chart.elasticX() || _resizing || render) {
1242+
if (_chart.elasticX() && (!_chart.mouseZoomable() && !_rangeChart) || _resizing || render) {
12401243
_chart.renderXAxis(_chart.g());
12411244
}
12421245

0 commit comments

Comments
 (0)