Skip to content

Commit

Permalink
Fixed an error when plotting an empty dataset.
Browse files Browse the repository at this point in the history
This was accidentally introduced by #1200; we can’t assume that
axis.ticks is an array.
  • Loading branch information
dnschnur committed Nov 28, 2013
1 parent 525d46e commit 39bc058
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jquery.flot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 39bc058

Please sign in to comment.