[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
<5.1.1.6.0.20020711092717.009fb350@imap.datacraft.com.br>, Marcus
Vinicius Laranjeira<br>
<m.laranjeira@datacraft.com.br> writes<br>
><br>
><br>
>All,<br>
><br>
>I am currently having this problem: When I try to plot a
horizontalbarchart <br>
>with less than 5 data series the chart is ploted correctly, when it
has 5 <br>
>or more data series, some black lines are ploted without a pattern,
i.e., <br>
.......<br>
>Please help !<br>
><br>
>Thanks,<br>
><br>
>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 & 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>
def
__init__(self,width=3D400,height=3D200,*args,**kw):<br>
&nbs=
p;
apply(Drawing.__init__,(self,width,height)+args,kw)<br>
&nbs=
p;
self.add(HorizontalBarChart(),'chart')<br>
&nbs=
p;
self.chart.y =3D 20<br>
&nbs=
p;
self.chart.data =3D [(100, 110, 120, 130,100,10), (70, 80, 85,
90,50,60)]<br>
&nbs=
p;
self.chart.valueAxis.forceZero =3D 1<br>
&nbs=
p;
self.chart.width =3D self.width-10-self.chart.x<br>
&nbs=
p;
self.chart.height =3D self.height - 10 - self.chart.y<br><br>
if __name__=3D=3D"__main__": #NORUNTESTS<br>
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--