Skip to content

Commit 39bc058

Browse files
committed
Fixed an error when plotting an empty dataset.
This was accidentally introduced by flot#1200; we can’t assume that axis.ticks is an array.
1 parent 525d46e commit 39bc058

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: jquery.flot.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1519,8 +1519,8 @@ Licensed under the MIT license.
15191519
// labels but instead use the overall width/height to not
15201520
// jump as much around with replots
15211521
$.each(allAxes(), function (_, axis) {
1522-
var lastTick = axis.ticks[axis.ticks.length - 1];
1523-
if (axis.reserveSpace && lastTick) {
1522+
if (axis.reserveSpace && axis.ticks && axis.ticks.length) {
1523+
var lastTick = axis.ticks[axis.ticks.length - 1];
15241524
if (axis.direction === "x") {
15251525
margins.left = Math.max(margins.left, axis.labelWidth / 2);
15261526
if (lastTick.v <= axis.max) {

0 commit comments

Comments
 (0)