From 6a39c5ba11f5cf53a81b59a82b1ead381756fc48 Mon Sep 17 00:00:00 2001 From: David Schnur Date: Mon, 22 Jul 2013 11:41:13 -0400 Subject: [PATCH] Always simply default to center alignment. Throwing an exception was overkill for such a limited-use option; we should reserve those, and the file-size bytes they consume, for serious cases only. --- jquery.flot.js | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/jquery.flot.js b/jquery.flot.js index 500e690..a1c97f5 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -1218,11 +1218,8 @@ Licensed under the MIT license. case "right": delta = -s.bars.barWidth; break; - case "center": - delta = -s.bars.barWidth / 2; - break; default: - throw new Error("Invalid bar alignment: " + s.bars.align); + delta = -s.bars.barWidth / 2; } if (s.bars.horizontal) { @@ -2609,11 +2606,8 @@ Licensed under the MIT license. case "right": barLeft = -series.bars.barWidth; break; - case "center": - barLeft = -series.bars.barWidth / 2; - break; default: - throw new Error("Invalid bar alignment: " + series.bars.align); + barLeft = -series.bars.barWidth / 2; } var fillStyleCallback = series.bars.fill ? function (bottom, top) { return getFillStyle(series.bars, series.color, bottom, top); } : null; @@ -2809,11 +2803,8 @@ Licensed under the MIT license. case "right": barLeft = -s.bars.barWidth; break; - case "center": - barLeft = -s.bars.barWidth / 2; - break; default: - throw new Error("Invalid bar alignment: " + s.bars.align); + barLeft = -s.bars.barWidth / 2; } barRight = barLeft + s.bars.barWidth; @@ -3023,11 +3014,8 @@ Licensed under the MIT license. case "right": barLeft = -series.bars.barWidth; break; - case "center": - barLeft = -series.bars.barWidth / 2; - break; default: - throw new Error("Invalid bar alignment: " + series.bars.align); + barLeft = -series.bars.barWidth / 2; } octx.lineWidth = series.bars.lineWidth;