Exemple #1
0
 def createXAxis (self):
     ax = Group ()
     x = self.canvas.x - self.canvas.height
     y = self.canvas.y + self.canvas.height
     ax.appendTransform (Rotate (-90, self.canvas.x, y))
     if self.settings.horizontal:
         UnifiedGraph.createXAxis (self)
     else:
         textProperties = {'textHeight': self.settings.xAxisTextHeight,
                           'verticalAnchor': 'middle',
                           'horizontalAnchor': 'right',
                           }
         xaxis = YAxis (id = 'x-axis',
                        inf = self.canvas.y + self.canvas.height,
                        sup = self.canvas.y + self.canvas.height - self.canvas.width,
                        x = self.canvas.x - self.canvas.height - self.settings.xAxisSpace,
                        lower = self.xbounds[0],
                        upper = self.xbounds[1],
                        textProperties = textProperties)
         ticks = []
         labels = []
         for child in self.canvas.data:
             if child.xml.has_key ('name'):
                 ticks.append (child.x + child.width / 2.0)
                 labels.append (child.xml['data'])
         xaxis.createTicks (ticks)
         xaxis.setText (map (str, labels))
         xaxis.drawTicks ()
         ax.draw (xaxis)
         self.dataGroup.drawAt (ax, 0)
Exemple #2
0
 def createXAxis(self):
     ax = Group()
     x = self.canvas.x - self.canvas.height
     y = self.canvas.y + self.canvas.height
     ax.appendTransform(Rotate(-90, self.canvas.x, y))
     if self.settings.horizontal:
         UnifiedGraph.createXAxis(self)
     else:
         textProperties = {
             'textHeight': self.settings.xAxisTextHeight,
             'verticalAnchor': 'middle',
             'horizontalAnchor': 'right',
         }
         xaxis = YAxis(id='x-axis',
                       inf=self.canvas.y + self.canvas.height,
                       sup=self.canvas.y + self.canvas.height -
                       self.canvas.width,
                       x=self.canvas.x - self.canvas.height -
                       self.settings.xAxisSpace,
                       lower=self.xbounds[0],
                       upper=self.xbounds[1],
                       textProperties=textProperties)
         ticks = []
         labels = []
         for child in self.canvas.data:
             if child.xml.has_key('name'):
                 ticks.append(child.x + child.width / 2.0)
                 labels.append(child.xml['data'])
         xaxis.createTicks(ticks)
         xaxis.setText(map(str, labels))
         xaxis.drawTicks()
         ax.draw(xaxis)
         self.dataGroup.drawAt(ax, 0)