Commit 6a39c5ba authored by David Schnur's avatar David Schnur

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.
parent 2ce1139c
...@@ -1218,11 +1218,8 @@ Licensed under the MIT license. ...@@ -1218,11 +1218,8 @@ Licensed under the MIT license.
case "right": case "right":
delta = -s.bars.barWidth; delta = -s.bars.barWidth;
break; break;
case "center":
delta = -s.bars.barWidth / 2;
break;
default: default:
throw new Error("Invalid bar alignment: " + s.bars.align); delta = -s.bars.barWidth / 2;
} }
if (s.bars.horizontal) { if (s.bars.horizontal) {
...@@ -2609,11 +2606,8 @@ Licensed under the MIT license. ...@@ -2609,11 +2606,8 @@ Licensed under the MIT license.
case "right": case "right":
barLeft = -series.bars.barWidth; barLeft = -series.bars.barWidth;
break; break;
case "center":
barLeft = -series.bars.barWidth / 2;
break;
default: 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; 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. ...@@ -2809,11 +2803,8 @@ Licensed under the MIT license.
case "right": case "right":
barLeft = -s.bars.barWidth; barLeft = -s.bars.barWidth;
break; break;
case "center":
barLeft = -s.bars.barWidth / 2;
break;
default: default:
throw new Error("Invalid bar alignment: " + s.bars.align); barLeft = -s.bars.barWidth / 2;
} }
barRight = barLeft + s.bars.barWidth; barRight = barLeft + s.bars.barWidth;
...@@ -3023,11 +3014,8 @@ Licensed under the MIT license. ...@@ -3023,11 +3014,8 @@ Licensed under the MIT license.
case "right": case "right":
barLeft = -series.bars.barWidth; barLeft = -series.bars.barWidth;
break; break;
case "center":
barLeft = -series.bars.barWidth / 2;
break;
default: default:
throw new Error("Invalid bar alignment: " + series.bars.align); barLeft = -series.bars.barWidth / 2;
} }
octx.lineWidth = series.bars.lineWidth; octx.lineWidth = series.bars.lineWidth;
......
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