Skip to content

Commit 54cbaed

Browse files
karolkolodziejTorsteinHonsi
authored andcommitted
Fixed #15864, navigation had the wrong position after adding series.
1 parent 27903b5 commit 54cbaed

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

samples/unit-tests/navigator/navigator/demo.js

+17
Original file line numberDiff line numberDiff line change
@@ -1289,3 +1289,20 @@ QUnit.test('Scrolling when the range is set, #14742.', function (assert) {
12891289
the range should not equal zero.`
12901290
);
12911291
});
1292+
1293+
1294+
QUnit.test('Initiation chart without data but with set range, #15864.', function (assert) {
1295+
const chart = Highcharts.stockChart('container', {
1296+
rangeSelector: {
1297+
selected: 1
1298+
},
1299+
series: [{
1300+
pointInterval: 36e7
1301+
}]
1302+
});
1303+
assert.ok(
1304+
chart.xAxis[0].max !== 0,
1305+
`After adding series to the chart that has set the range,
1306+
the navigator shouldn't stick to min.`
1307+
);
1308+
});

ts/Core/Navigator.ts

+2
Original file line numberDiff line numberDiff line change
@@ -2599,6 +2599,8 @@ class Navigator {
25992599
// updated dataset, we must adjust.
26002600
stickToMin = min <= xDataMin;
26012601
}
2602+
} else {
2603+
stickToMin = false; // #15864
26022604
}
26032605

26042606
return stickToMin;

0 commit comments

Comments
 (0)