#Autogenerated by ReportLab guiedit do not edit
from d_horizontalbarchart import HorizontalBarChart
from reportlab.graphics.shapes import _DrawingEditorMixin
from rlextra.graphics.guiedit.datacharts import ODBCDataSource, DataAssociation, DataAwareDrawing, Array

class HorizontalBarChartDrawing(_DrawingEditorMixin,DataAwareDrawing):
	def __init__(self,width=400,height=200,*args,**kw):
		DataAwareDrawing.__init__(self,width,height,*args,**kw)
		self._add(self,HorizontalBarChart(),name='HorizontalBarChart',validate=None,desc='The main chart')
		self._fontName                  = 'Courier-Bold'
		self.height                    = 105
		self.width                     = 145
		self.dataSource                = ODBCDataSource()
		self.dataSource.sql            = 'SELECT chartId, name, value1, value2 FROM generic_bar'
		self.dataSource.groupingColumn = 0
		self.dataSource.associations   = Array(4, DataAssociation)
		self.dataSource.associations.element00 = DataAssociation(column=0, target='chartId', assocType='scalar')
		self.dataSource.associations.element01 = DataAssociation(column=1, target='HorizontalBarChart.categoryNames', assocType='vector')
		self.dataSource.associations.element02 = DataAssociation(column=[2], target='HorizontalBarChart.data', assocType='tmatrix')
		self.dataSource.associations.element03 = DataAssociation(column=3, target='HorizontalBarChart.labelRow2', assocType='vector')
		self.formats         = ['eps', 'pdf', 'gif', 'jpg','png']
		self.verbose         = 1
		self.outDir          = './output/'
		self.fileNamePattern = 'horizontalbarchart%03d'

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