You can clone with
Original author: gcph...@gmail.com (March 24, 2011 23:37:15)
just started using flot and noticed in testing and in the demo that the bar graphs borders, by default, over-lap the outside border of the grid
this looks pretty ugly
i had to modify the drawBar() function with some hacks to make mine look fine:
lines 2053 threw 2055
left = .02+ x + barLeft;
right = .02+x + barRight;
bottom = .02+b;
bottom = 1+tmp;
Now the borders do not over-lap and it looks much cleaner
Original issue: http://code.google.com/p/flot/issues/detail?id=494
From olau%iol...@gtempaccount.com on April 04, 2011 10:37:10
Hi, if you're interested in helping out, I think the proper way to fix this is adjusting the bars with half the line width.
From drrc...@gmail.com on July 14, 2012 22:51:03
It would seem ideal to modify barLeft and barRight where they are initialized in drawBarSeries, but these use units of the x-axis. This makes it difficult to adjust for pixel differences. The units must be converted to pixels at some point however, so barring problems with fractional behavior, the fix should be relatively straightforward. Conversion is done by the p2c method. I just need to fully understand it.
The adjustments must take into account the linewidth set, as well as the bar width. But since you can set the bar width anyway, what's the point? Should flot really be scaling down all the other graphs for this reason?
One other possibility is to adjust only if the bar outline would touch the outside grid. This would render the first bar a slightly lesser width than others in the series, though, so this solution is unappealing.
You could also simply omit the offending border outline. It doesn't look too bad.
Yet another way is to offset the axis itself and leave everything else alone. This seems.. complex.
Overall, though, I don't know if dynamically adjusting the area of bar graphs is a good idea. Will work on this next week.