[jToolkit-cvs] jToolkit/widgets chart.py,1.19,1.20
Brought to you by:
davidfraser,
friedelwolff
From: <dav...@us...> - 2004-02-10 09:21:14
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27650 Modified Files: chart.py Log Message: Changed chart width slightly. Added mapping from None for the graph Index: chart.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/chart.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** chart.py 10 Feb 2004 09:14:01 -0000 1.19 --- chart.py 10 Feb 2004 09:18:01 -0000 1.20 *************** *** 45,49 **** def sizeimage(self): """Subclasses of this should implement this uniquely""" ! self.im_width = 18 self.im_height = 9 --- 45,49 ---- def sizeimage(self): """Subclasses of this should implement this uniquely""" ! self.im_width = 17.5 self.im_height = 9 *************** *** 80,83 **** --- 80,89 ---- Chart.__init__(self, charttable, filter) + def mapfromNone(self, value): + if value == None: + return 0 + else: + return value + def getdata(self): chartdata = self.charttable.gettablerows(self.filter) *************** *** 91,95 **** else: self.xdata = [str(row[self.xcolumn]) for row in chartdata] ! self.ydata = [[row[ycolumn] for row in chartdata] for ycolumn in self.ycolumns] self.legendlabels = [str(ycolumn) for ycolumn in self.ycolumns] --- 97,101 ---- else: self.xdata = [str(row[self.xcolumn]) for row in chartdata] ! self.ydata = [[self.mapfromNone(row[ycolumn]) for row in chartdata] for ycolumn in self.ycolumns] self.legendlabels = [str(ycolumn) for ycolumn in self.ycolumns] *************** *** 107,111 **** for dataset in self.ydata: for value in dataset: ! if value < ymin: ymin = value if value > ymax: --- 113,117 ---- for dataset in self.ydata: for value in dataset: ! if value < ymin and value != None: ymin = value if value > ymax: |