Commit 360e57dc authored by David Schnur's avatar David Schnur

Minor cleanup on recently-merged code, for consistency.

parent e7634c64
...@@ -665,25 +665,25 @@ ...@@ -665,25 +665,25 @@
} }
} }
} }
if (s.bars.show) { if (s.bars.show) {
// make sure we got room for the bar on the dancing floor // make sure we got room for the bar on the dancing floor
var delta; var delta;
switch (s.bars.align) { switch (s.bars.align) {
case 'left': case "left":
delta = 0; delta = 0;
break; break;
case 'right': case "right":
delta = -s.bars.barWidth; delta = -s.bars.barWidth;
break; break;
case 'center': case "center":
delta = -s.bars.barWidth / 2; delta = -s.bars.barWidth / 2;
break; break;
default: default:
throw 'Invalid bar alignment: ' + s.bars.align; throw new Error("Invalid bar alignment: " + s.bars.align);
} }
if (s.bars.horizontal) { if (s.bars.horizontal) {
ymin += delta; ymin += delta;
ymax += delta + s.bars.barWidth; ymax += delta + s.bars.barWidth;
...@@ -2225,23 +2225,23 @@ ...@@ -2225,23 +2225,23 @@
// FIXME: figure out a way to add shadows (for instance along the right edge) // FIXME: figure out a way to add shadows (for instance along the right edge)
ctx.lineWidth = series.bars.lineWidth; ctx.lineWidth = series.bars.lineWidth;
ctx.strokeStyle = series.color; ctx.strokeStyle = series.color;
var barLeft; var barLeft;
switch (series.bars.align) { switch (series.bars.align) {
case 'left': case "left":
barLeft = 0; barLeft = 0;
break; break;
case 'right': case "right":
barLeft = -series.bars.barWidth; barLeft = -series.bars.barWidth;
break; break;
case 'center': case "center":
barLeft = -series.bars.barWidth / 2; barLeft = -series.bars.barWidth / 2;
break; break;
default: default:
throw 'Invalid bar alignment: ' + series.bars.align; throw new Error("Invalid bar alignment: " + series.bars.align);
} }
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;
plotBars(series.datapoints, barLeft, barLeft + series.bars.barWidth, 0, fillStyleCallback, series.xaxis, series.yaxis); plotBars(series.datapoints, barLeft, barLeft + series.bars.barWidth, 0, fillStyleCallback, series.xaxis, series.yaxis);
ctx.restore(); ctx.restore();
......
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