Commit 39bc058b authored by David Schnur's avatar David Schnur

Fixed an error when plotting an empty dataset.

This was accidentally introduced by #1200; we can’t assume that
axis.ticks is an array.
parent 525d46ea
...@@ -1519,8 +1519,8 @@ Licensed under the MIT license. ...@@ -1519,8 +1519,8 @@ Licensed under the MIT license.
// labels but instead use the overall width/height to not // labels but instead use the overall width/height to not
// jump as much around with replots // jump as much around with replots
$.each(allAxes(), function (_, axis) { $.each(allAxes(), function (_, axis) {
var lastTick = axis.ticks[axis.ticks.length - 1]; if (axis.reserveSpace && axis.ticks && axis.ticks.length) {
if (axis.reserveSpace && lastTick) { 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) { if (lastTick.v <= axis.max) {
......
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