Commit 479fa278 authored by olau@iola.dk's avatar olau@iola.dk

Fixed problem with turning off bar outline (issue 253, fix by Jordi Castells)


git-svn-id: https://flot.googlecode.com/svn/trunk@245 1e0a6537-2640-0410-bfb7-f154510ff394
parent 5d68d11b
...@@ -37,6 +37,8 @@ Bug fixes: ...@@ -37,6 +37,8 @@ Bug fixes:
Issue 316 reported by curlypaul924. Issue 316 reported by curlypaul924.
- More robust handling of axis from data passed in from getData() - More robust handling of axis from data passed in from getData()
(problem reported by Morgan). (problem reported by Morgan).
- Fixed problem with turning off bar outline (issue 253, fix by Jordi
Castells).
Flot 0.6 Flot 0.6
-------- --------
......
...@@ -223,6 +223,7 @@ ...@@ -223,6 +223,7 @@
if (options.shadowSize) if (options.shadowSize)
options.series.shadowSize = options.shadowSize; options.series.shadowSize = options.shadowSize;
// add hooks from options
for (var n in hooks) for (var n in hooks)
if (options.hooks[n] && options.hooks[n].length) if (options.hooks[n] && options.hooks[n].length)
hooks[n] = hooks[n].concat(options.hooks[n]); hooks[n] = hooks[n].concat(options.hooks[n]);
...@@ -1590,7 +1591,7 @@ ...@@ -1590,7 +1591,7 @@
ctx.restore(); ctx.restore();
} }
function drawBar(x, y, b, barLeft, barRight, offset, fillStyleCallback, axisx, axisy, c, horizontal) { function drawBar(x, y, b, barLeft, barRight, offset, fillStyleCallback, axisx, axisy, c, horizontal, lineWidth) {
var left, right, bottom, top, var left, right, bottom, top,
drawLeft, drawRight, drawTop, drawBottom, drawLeft, drawRight, drawTop, drawBottom,
tmp; tmp;
...@@ -1675,7 +1676,7 @@ ...@@ -1675,7 +1676,7 @@
} }
// draw outline // draw outline
if (drawLeft || drawRight || drawTop || drawBottom) { if (lineWidth > 0 && (drawLeft || drawRight || drawTop || drawBottom)) {
c.beginPath(); c.beginPath();
// FIXME: inline moveTo is buggy with excanvas // FIXME: inline moveTo is buggy with excanvas
...@@ -1707,7 +1708,7 @@ ...@@ -1707,7 +1708,7 @@
for (var i = 0; i < points.length; i += ps) { for (var i = 0; i < points.length; i += ps) {
if (points[i] == null) if (points[i] == null)
continue; continue;
drawBar(points[i], points[i + 1], points[i + 2], barLeft, barRight, offset, fillStyleCallback, axisx, axisy, ctx, series.bars.horizontal); drawBar(points[i], points[i + 1], points[i + 2], barLeft, barRight, offset, fillStyleCallback, axisx, axisy, ctx, series.bars.horizontal, series.bars.lineWidth);
} }
} }
...@@ -2046,7 +2047,7 @@ ...@@ -2046,7 +2047,7 @@
var fillStyle = $.color.parse(series.color).scale('a', 0.5).toString(); var fillStyle = $.color.parse(series.color).scale('a', 0.5).toString();
var barLeft = series.bars.align == "left" ? 0 : -series.bars.barWidth/2; var barLeft = series.bars.align == "left" ? 0 : -series.bars.barWidth/2;
drawBar(point[0], point[1], point[2] || 0, barLeft, barLeft + series.bars.barWidth, drawBar(point[0], point[1], point[2] || 0, barLeft, barLeft + series.bars.barWidth,
0, function () { return fillStyle; }, series.xaxis, series.yaxis, octx, series.bars.horizontal); 0, function () { return fillStyle; }, series.xaxis, series.yaxis, octx, series.bars.horizontal, series.bars.lineWidth);
} }
function getColorOrGradient(spec, bottom, top, defaultColor) { function getColorOrGradient(spec, bottom, top, defaultColor) {
......
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