[reportlab-users] Bug in reportlab horizontal/vertical bar chart modules ????

Marcus Vinicius Laranjeira reportlab-users@reportlab.com
Thu, 11 Jul 2002 15:38:20 -0300


--=====================_260120513==.ALT
Content-Type: text/plain; charset="iso-8859-1"; format=flowed
Content-Transfer-Encoding: quoted-printable

Robin,

I can't save the chart as a PDF since this chart is inserted in a flowable=
=20
and then in a PDF...

I have made tests and the problem is happening actually with 9 or more data=
=20
in the data series... with less than 9 (i.e. 8, 7...) it seems to create=20
the chart fine...

Any other suggestion !?

Thanks,

Marcus

PS: I am in a hurry.... please heeeellllllpppppppp :-)

At 19:23 11/07/02 +0100, you wrote:
>In article <5.1.1.6.0.20020711092717.009fb350@imap.datacraft.com.br>,=20
>Marcus Vinicius Laranjeira
><m.laranjeira@datacraft.com.br> writes
> >
> >
> >All,
> >
> >I am currently having this problem: When I try to plot a=
 horizontalbarchart
> >with less than 5 data series the chart is ploted correctly, when it has 5
> >or more data series, some black lines are ploted without a pattern, i.e.,
>.......
> >Please help !
> >
> >Thanks,
> >
> >Marcus
>Here is one I ran up without too much trouble. If you change the 'pdf'
>to 'gif' it will output a gif etc etc. has
>two data in six categories. You can try setting the data to
>self.chart.data =3D [(100, 110, 120, 130,100,10), (70, 80, 85,=20
>90,50,60),(70, 80, 85, 90,50,60),(70, 80,
>85, 90,50,60),(70, 80, 85, 90,50,60),(70, 80, 85, 30,50,60)]
>
>to get 6 data & 6 categories so there's no real limitation. The base colors
>would need adjusting though.
>
>
>from reportlab.graphics.charts.barcharts import HorizontalBarChart
>from reportlab.graphics.shapes import Drawing
>class Drawing_000(Drawing):
>         def __init__(self,width=3D400,height=3D200,*args,**kw):
>                 apply(Drawing.__init__,(self,width,height)+args,kw)
>                 self.add(HorizontalBarChart(),'chart')
>                 self.chart.y =3D 20
>                 self.chart.data =3D [(100, 110, 120, 130,100,10), (70, 80,=
=20
> 85, 90,50,60)]
>                 self.chart.valueAxis.forceZero =3D 1
>                 self.chart.width =3D self.width-10-self.chart.x
>                 self.chart.height =3D self.height - 10 - self.chart.y
>
>if __name__=3D=3D"__main__": #NORUNTESTS
>         Drawing_000().save(formats=3D['pdf'],outDir=3D'.',fnRoot=3DNone)
>--
>Robin Becker
>_______________________________________________
>reportlab-users mailing list
>reportlab-users@reportlab.com
>http://two.pairlist.net/mailman/listinfo/reportlab-users




Marcus Vinicius Laranjeira
MON Center

Datacraft do Brasil - (http://www.datacraft.com.br)
R. Tenente Negr=E3o, 140 - 8o. Andar
Itaim Bibi - S=E3o Paulo - SP - 04530-030
Tel: +55-11-3053-0241
Fax: +55-11-3053-0220
--=====================_260120513==.ALT
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
Robin,<br><br>
I can't save the chart as a PDF since this chart is inserted in a
flowable and then in a PDF...<br><br>
I have made tests and the problem is happening actually with 9 or more
data in the data series... with less than 9 (i.e. 8, 7...) it seems to
create the chart fine...<br><br>
Any other suggestion !?<br><br>
Thanks,<br><br>
Marcus<br><br>
PS: I am in a hurry.... please heeeellllllpppppppp :-) <br><br>
At 19:23 11/07/02 +0100, you wrote:<br>
<blockquote type=3Dcite class=3Dcite cite>In article
&lt;5.1.1.6.0.20020711092717.009fb350@imap.datacraft.com.br&gt;, Marcus
Vinicius Laranjeira<br>
&lt;m.laranjeira@datacraft.com.br&gt; writes<br>
&gt;<br>
&gt;<br>
&gt;All,<br>
&gt;<br>
&gt;I am currently having this problem: When I try to plot a
horizontalbarchart <br>
&gt;with less than 5 data series the chart is ploted correctly, when it
has 5 <br>
&gt;or more data series, some black lines are ploted without a pattern,
i.e., <br>
.......<br>
&gt;Please help !<br>
&gt;<br>
&gt;Thanks,<br>
&gt;<br>
&gt;Marcus<br>
Here is one I ran up without too much trouble. If you change the
'pdf'<br>
to 'gif' it will output a gif etc etc. has <br>
two data in six categories. You can try setting the data to<br>
self.chart.data =3D [(100, 110, 120, 130,100,10), (70, 80, 85,
90,50,60),(70, 80, 85, 90,50,60),(70, 80,<br>
85, 90,50,60),(70, 80, 85, 90,50,60),(70, 80, 85, 30,50,60)]<br><br>
to get 6 data &amp; 6 categories so there's no real limitation. The base
colors<br>
would need adjusting though.<br><br>
<br>
from reportlab.graphics.charts.barcharts import HorizontalBarChart<br>
from reportlab.graphics.shapes import Drawing<br>
class Drawing_000(Drawing):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def
__init__(self,width=3D400,height=3D200,*args,**kw):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;
apply(Drawing.__init__,(self,width,height)+args,kw)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;
self.add(HorizontalBarChart(),'chart')<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;
self.chart.y =3D 20<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;
self.chart.data =3D [(100, 110, 120, 130,100,10), (70, 80, 85,
90,50,60)]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;
self.chart.valueAxis.forceZero =3D 1<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;
self.chart.width =3D self.width-10-self.chart.x<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;
self.chart.height =3D self.height - 10 - self.chart.y<br><br>
if __name__=3D=3D&quot;__main__&quot;: #NORUNTESTS<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Drawing_000().save(formats=3D['pdf'],outDir=3D'.',fnRoot=3DNone)<br>
-- <br>
Robin Becker<br>
_______________________________________________<br>
reportlab-users mailing list<br>
reportlab-users@reportlab.com<br>
<a href=3D"http://two.pairlist.net/mailman/listinfo/reportlab-users"=
 eudora=3D"autourl">http://two.pairlist.net/mailman/listinfo/reportlab-users=
</a></blockquote>
<x-sigsep><p></x-sigsep>
<font face=3D"Courier New, Courier"><br><br>
<br>
Marcus Vinicius Laranjeira<br>
MON Center <br><br>
Datacraft do Brasil -
(<a href=3D"http://www.datacraft.com.br/" eudora=3D"autourl">http://www.data=
craft.com.br</a>)
<br>
R. Tenente Negr=E3o, 140 - 8o. Andar <br>
Itaim Bibi - S=E3o Paulo - SP - 04530-030 <br>
Tel: +55-11-3053-0241<br>
Fax: +55-11-3053-0220</font></html>

--=====================_260120513==.ALT--