Commit 0beb104e authored by David Schnur's avatar David Schnur

Revert #1200; it was causing #1283 breakages.

The fix for an unnecessary gap on the right of the chart turned out to
break text wrapping for ticks that were legitimately in that position.

Fixes #1283.
parent 2a3e3cd4
...@@ -1550,17 +1550,12 @@ Licensed under the MIT license. ...@@ -1550,17 +1550,12 @@ Licensed under the MIT license.
// jump as much around with replots // jump as much around with replots
$.each(allAxes(), function (_, axis) { $.each(allAxes(), function (_, axis) {
if (axis.reserveSpace && axis.ticks && axis.ticks.length) { if (axis.reserveSpace && axis.ticks && axis.ticks.length) {
var lastTick = axis.ticks[axis.ticks.length - 1];
if (axis.direction === "x") { if (axis.direction === "x") {
margins.left = Math.max(margins.left, axis.labelWidth / 2); margins.left = Math.max(margins.left, axis.labelWidth / 2);
if (lastTick.v <= axis.max) { margins.right = Math.max(margins.right, axis.labelWidth / 2);
margins.right = Math.max(margins.right, axis.labelWidth / 2);
}
} else { } else {
margins.bottom = Math.max(margins.bottom, axis.labelHeight / 2); margins.bottom = Math.max(margins.bottom, axis.labelHeight / 2);
if (lastTick.v <= axis.max) { margins.top = Math.max(margins.top, axis.labelHeight / 2);
margins.top = Math.max(margins.top, axis.labelHeight / 2);
}
} }
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment