[jToolkit-cvs] jToolkit/widgets chart.py,1.11,1.12
Brought to you by:
davidfraser,
friedelwolff
From: <dav...@us...> - 2004-02-10 09:03:36
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24296 Modified Files: chart.py Log Message: Fixed display of time on first graph Index: chart.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/chart.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** chart.py 10 Feb 2004 08:57:44 -0000 1.11 --- chart.py 10 Feb 2004 09:00:14 -0000 1.12 *************** *** 45,50 **** def sizeimage(self): """Subclasses of this should implement this uniquely""" ! self.im_width = 8 ! self.im_height = 6 def option(self, **args): --- 45,50 ---- def sizeimage(self): """Subclasses of this should implement this uniquely""" ! self.im_width = 12 ! self.im_height = 9 def option(self, **args): *************** *** 89,95 **** chartdata = self.charttable.gettablerows(self.filter) if self.xstorageformat == 'DATETIME': ! self.xdata = array([dates.formatdate(row[self.xcolumn],self.xdisplay) for row in chartdata]) else: ! self.xdata = array([str(row[self.xcolumn]) for row in chartdata]) self.ydata = [[row[ycolumn] for row in chartdata] for ycolumn in self.ycolumns] --- 89,95 ---- chartdata = self.charttable.gettablerows(self.filter) if self.xstorageformat == 'DATETIME': ! self.xdata = [dates.formatdate(row[self.xcolumn],self.xdisplay) for row in chartdata] else: ! self.xdata = [str(row[self.xcolumn]) for row in chartdata] self.ydata = [[row[ycolumn] for row in chartdata] for ycolumn in self.ycolumns] *************** *** 115,121 **** sliceNum = len(self.xdata)/numLabels #Set the x labels self.figure.get_current_axis().set_xticks(arange(len(self.xdata),step=sliceNum)) ! self.figure.get_current_axis().set_xticklabels(self.xdata[:1]+self.xdata[::sliceNum]+self.xdata[-1:],rotation='vertical') #Plot each dataset --- 115,128 ---- sliceNum = len(self.xdata)/numLabels + currentxdata = self.xdata[:1] + currentxpos = sliceNum + while currentxpos < len(self.xdata): + currentxdata.append(self.xdata[currentxpos]) + currentxpos += sliceNum + if currentxpos != len(self.xdata)+sliceNum-1: + currentxdata.extend(self.xdata[-1:]) #Set the x labels self.figure.get_current_axis().set_xticks(arange(len(self.xdata),step=sliceNum)) ! self.figure.get_current_axis().set_xticklabels(currentxdata,rotation='vertical') #Plot each dataset |