[reportlab-users] Missing area charts
    Robin Becker 
    robin at reportlab.com
       
    Fri May 29 06:30:10 EDT 2009
    
    
  
Dinu Gherman wrote:
> Dinu Gherman:
> 
>> Ok, I found AreaLinePlot, but not a test illustrating it, at
>> least not in a way that would make it instantly visible as an
>> area chart. I guess (and hope) it is implicitly stacked (in-
>> heriting from LinePlot with multiple series)...
> 
> 
> Maybe I was overly optimistic... While trying AreaLinePlot like
> it is (or rather: like it should be) used on page 155 of the file
> graphics_reference.pdf I get an error like this:
> 
> [...]
> /reportlab/graphics/charts/lineplots.py", line 748, in draw
>     S[j] = S[j] + odata[j][i]
> TypeError: unsupported operand type(s) for +: 'int' and 'tuple'
> 
> Is this expected to work and if so, where can I find some sample
> or test code proving that it really works?
> 
> Thanks,
> 
> Dinu
> 
from reportlab.graphics.shapes import Drawing
from reportlab.graphics.charts.lineplots import AreaLinePlot
class Drawing_000(Drawing):
	def __init__(self,width=400,height=200,*args,**kw):
		Drawing.__init__(*((self,width,height)+args),**kw)
		self.add(AreaLinePlot())
		self.contents[0].y				  = 20
		self.contents[0].width			  = 360
		self.contents[0].height			  = 170
if __name__=="__main__": #NORUNTESTS
	Drawing_000().save(formats=['pdf'],outDir='.',fnRoot=None)
-- 
Robin Becker
    
    
More information about the reportlab-users
mailing list