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.
// labels but instead use the overall width/height to not
// jump as much around with replots
$.each(allAxes(), function (_, axis) {
var lastTick = axis.ticks[axis.ticks.length - 1];
if (axis.reserveSpace && lastTick) {
if (axis.reserveSpace && axis.ticks && axis.ticks.length) {
var lastTick = axis.ticks[axis.ticks.length - 1];
if (axis.direction === "x") {
margins.left = Math.max(margins.left, axis.labelWidth / 2);
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