[reportlab-users] Bug in reportlab horizontal/vertical bar chart modules ????
Robin Becker
reportlab-users@reportlab.com
Mon, 15 Jul 2002 19:42:58 +0100
In article <5.1.1.6.0.20020715102126.009d14a0@imap.datacraft.com.br>, Marcus Vinicius Laranjeira <m.laranjeira@datacraft.com.br>
writes
> Robin, folks,
>
> I really need help on this... Please help me solve this problem...
>
> I really appreciate !
>
> Cheers,
>
> Marcus
>
.....
OK I found the problem, the barchart class likes colours in the categories to be different so you had to define lot's of zero
values to
get the different colors. The archart was stupid about removing collapsed rectangles and that excites a problem in the PM
renderer's base library that causes the stupid thing to fall over when doing lot's of zero width/height rectangles.
I fixed this in the base library by eliminating the zero data in the barchart makeBars function at line 420 it now says
elif abs(width)>1e-7 and abs(height)>=1e-7 and (rowStyle.fillColor is not None or rowStyle.strokeColor is not None):
r = Rect(x, y, width, height)
r.strokeWidth = rowStyle.strokeWidth ## added line - now actually uses strokeWidth
r.fillColor = rowStyle.fillColor
r.strokeColor = rowStyle.strokeColor
g.add(r)
I will have a think on what to do about the general problem
--
Robin Becker