#Autogenerated by ReportLab guiedit do not edit
from rlextra.graphics.guiedit.datacharts import ODBCDataSource, DataAssociation, DataAwareDrawing
from reportlab.graphics.shapes import _DrawingEditorMixin
from reportlab.graphics.charts.dotbox import DotBox

class DotBoxDrawing(_DrawingEditorMixin,DataAwareDrawing):
	def __init__(self,width=400,height=200,*args,**kw):
		DataAwareDrawing.__init__(self,width,height,*args,**kw)
		self._add(self,DotBox(),name='DotBox',validate=None,desc='The main chart')
		self.height                       = 78
		self.width                        = 78
		self.dataSource                   = ODBCDataSource()
		self.dataSource.sql               = 'SELECT chartId,dotx,doty FROM generic_dotbox'
		self.dataSource.groupingColumn    = 0
		self.dataSource.associations.size = 3
		self.dataSource.associations.element00 = DataAssociation(column=0, target='chartId', assocType='scalar')
		self.dataSource.associations.element01 = DataAssociation(column=1, target='DotBox.dotXPosition', assocType='scalar')
		self.dataSource.associations.element02 = DataAssociation(column=2, target='DotBox.dotYPosition', assocType='scalar')
		self.verbose            = 1
		self.formats            = ['eps', 'pdf']
		self.outDir             = './output/'
		self.fileNamePattern    = 'dotbox%03d'


if __name__=="__main__": #NORUNTESTS
	DotBoxDrawing().go()
