Commit c60b9305 authored by olau@iola.dk's avatar olau@iola.dk

Commit patch to fix a bug with drawing bars extending below 0

git-svn-id: https://flot.googlecode.com/svn/trunk@70 1e0a6537-2640-0410-bfb7-f154510ff394
parent b66c291b
......@@ -19,7 +19,9 @@ the fill.
Fixed a bug in calculating spacing around the plot (reported by
timothytoe). Fixed a bug in finding max values for all-negative data
sets. Prevent the possibility of eternal looping in tick calculations.
Fixed a bug when borderWidth is set to 0 (reported by Rob/sanchothefat).
Fixed a bug when borderWidth is set to 0 (reported by
Rob/sanchothefat). Fixed a bug with drawing bars extending below 0
(reported by James Hewitt, convenient patch by Ryan Funduk).
Flot 0.4
......
......@@ -1212,8 +1212,10 @@
var x = data[i][0], y = data[i][1];
var drawLeft = true, drawTop = true, drawRight = true;
var left = x, right = x + barWidth, bottom = 0, top = y;
// determine the co-ordinates of the bar, account for negative bars having
// flipped top/bottom and draw/don't draw accordingly
var left = x, right = x + barWidth, bottom = (y < 0 ? y : 0), top = (y < 0 ? 0 : y);
if (right < xaxis.min || left > xaxis.max || top < yaxis.min || bottom > yaxis.max)
continue;
......
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