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

class VerticalBarChartDrawing(_DrawingEditorMixin,DataAwareDrawing):
	def __init__(self,width=400,height=200,*args,**kw):
		apply(DataAwareDrawing.__init__,(self,width,height)+args,kw)
		self._add(self,VerticalBarChart(),name='VerticalBarChart',validate=None,desc='The main chart')
		self.height             = 120
		self.width              = 170
		self.dataSource         = ODBCDataSource()
		self.dataSource.sql     = 'SELECT chartId, name, value1, value2 FROM generic_bar'
		self.dataSource.groupingColumn = 0
		self.dataSource.associations   = Array(3, DataAssociation)
		self.dataSource.associations.element00 = DataAssociation(column=0, target='chartId', assocType='scalar')
		self.dataSource.associations.element01 = DataAssociation(column=[2,3], target='VerticalBarChart.data', assocType='tmatrix')
		self.dataSource.associations.element02 = DataAssociation(column=1, target='VerticalBarChart.categoryAxis.categoryNames', assocType='vector')
		self.formats         = ['eps', 'pdf']
		self.verbose         = 1
		self.outDir          = './output/'
		self.fileNamePattern = 'verticalbarchart%03d'
		self.VerticalBarChart.x               = 0
		self.VerticalBarChart.y               = 0


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