From 5a0372159a3c9e17e134f2997799b03a37d9ed37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=20C=C3=B4t=C3=A9?= Date: Thu, 18 Jul 2013 22:28:10 -0400 Subject: [PATCH] Always remove the tick text in drawAxisLabels() regardless of axis settings. Since a plot may be redrawn after removing ticks or hiding the axis, the tick text should always be removed before determining if there are ticks to draw. --- jquery.flot.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jquery.flot.js b/jquery.flot.js index 13455bd..52c2d31 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -2100,9 +2100,6 @@ Licensed under the MIT license. function drawAxisLabels() { $.each(allAxes(), function (_, axis) { - if (!axis.show || axis.ticks.length == 0) - return; - var box = axis.box, legacyStyles = axis.direction + "Axis " + axis.direction + axis.n + "Axis", layer = "flot-" + axis.direction + "-axis flot-" + axis.direction + axis.n + "-axis " + legacyStyles, @@ -2111,6 +2108,9 @@ Licensed under the MIT license. surface.removeText(layer); + if (!axis.show || axis.ticks.length == 0) + return; + for (var i = 0; i < axis.ticks.length; ++i) { tick = axis.ticks[i];