#Autogenerated by ReportLab guiedit do not edit
from reportlab.graphics.charts.legends import Legend
from reportlab.graphics.widgets.markers import makeMarker
from reportlab.graphics.shapes import Drawing, _DrawingEditorMixin, String
from reportlab.graphics.charts.lineplots import LinePlot
from reportlab.lib.validators import Auto

class LegendDrawing(_DrawingEditorMixin,Drawing):
	def __init__(self,width=400,height=200,*args,**kw):
		Drawing.__init__(self,width,height,*args,**kw)
		self._add(self,LinePlot(),name='plot',validate=None,desc=None)
		self.plot.y                = 20
		self._add(self,String(200,180,"text"),name='title',validate=None,desc=None)
		self.title.fontSize   = 12
		self.title.textAnchor='middle'
		self.title.text       = 'Example 5 - auto legend with series names'
		self.title.fontName   = 'Times-Bold'
		self._add(self,Legend(),name='legend',validate=None,desc=None)
		self.legend.boxAnchor='sw'
		self.legend.x              = 220
		self.legend.y              = 20
		self.legend.colorNamePairs = Auto(chart=self.plot)
		self.plot.lines[0].symbol        = makeMarker('Diamond')
		self.plot.lines[0].name = 'sprockets'
		self.plot.lines[1].name        = 'widgets'

if __name__=="__main__": #NORUNTESTS
	LegendDrawing().save(formats=['pdf'],outDir='.',fnRoot=None)
