Skip to content

Commit

Permalink
Fixed #7226, zooming was not possible when softMin and softMax we…
Browse files Browse the repository at this point in the history
…re set.
  • Loading branch information
TorsteinHonsi committed Dec 7, 2017
1 parent 72d67bf commit 6e21acc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/parts/Axis.js
Expand Up @@ -2973,10 +2973,10 @@ H.extend(Axis.prototype, /** @lends Highcharts.Axis.prototype */{
}

// Handle options for floor, ceiling, softMin and softMax (#6359)
if (isNumber(options.softMin)) {
if (isNumber(options.softMin) && !isNumber(axis.userMin)) {
axis.min = Math.min(axis.min, options.softMin);
}
if (isNumber(options.softMax)) {
if (isNumber(options.softMax) && !isNumber(axis.userMax)) {
axis.max = Math.max(axis.max, options.softMax);
}
if (isNumber(options.floor)) {
Expand Down
14 changes: 14 additions & 0 deletions samples/unit-tests/axis/softmin-softmax/demo.js
Expand Up @@ -60,6 +60,20 @@ QUnit.test('softMin and softMax', function (assert) {
'Soft max, exceeded'
);


// Zoom in
chart.yAxis[0].setExtremes(50, 100);
assert.strictEqual(
chart.yAxis[0].min,
50,
'Soft min should allow zoom'
);
assert.strictEqual(
chart.yAxis[0].max,
100,
'Soft max should allow zoom'
);

});

QUnit.test('softMax combined with ceiling (#6359)', function (assert) {
Expand Down

0 comments on commit 6e21acc

Please sign in to comment.