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)
Exemple #3
0
 def createYAxis(self):
     if not self.settings.horizontal:
         UnifiedGraph.createYAxis(self)
     else:
         for child in self.canvas.data:
             self.ypositions.append(child.y + (child.height / 2.0))
             self.ylabels.append(child.xml['data'])
         UnifiedGraph.createYAxis(self)
Exemple #4
0
 def createYAxis (self):
     if not self.settings.horizontal:
         UnifiedGraph.createYAxis (self)
     else:
         for child in self.canvas.data:
             self.ypositions.append (child.y + (child.height / 2.0))
             self.ylabels.append (child.xml['data'])
         UnifiedGraph.createYAxis (self)
Exemple #5
0
    def formatSettings (self, settings):
        UnifiedGraph.formatSettings (self, settings)
        
        addAttr (settings, 'barColor', hex_to_color, Color (210, 10, 10))    
        addAttr (settings, 'barWidth', float, 1.0)    
        addAttr (settings, 'barSpacing', float, .1)    
        addAttr (settings, 'blankSpace', float, .5)

        addAttr (settings, 'horizontal', boolean, False)
Exemple #6
0
    def formatSettings(self, settings):
        UnifiedGraph.formatSettings(self, settings)

        addAttr(settings, 'barColor', hex_to_color, Color(210, 10, 10))
        addAttr(settings, 'barWidth', float, 1.0)
        addAttr(settings, 'barSpacing', float, .1)
        addAttr(settings, 'blankSpace', float, .5)

        addAttr(settings, 'horizontal', boolean, False)
Exemple #7
0
 def __init__ (self, **attr):
     """if attr.has_key ('horizontal') and attr['horizontal']:
         self.horizontal = True
         UnifiedGraph.__init__ (self, HorizontalBarCanvas, **attr)
     else:
         self.horizontal = False
         UnifiedGraph.__init__ (self, BarCanvas, **attr)"""
     UnifiedGraph.__init__ (self, None, **attr)
     if self.settings.horizontal == True:
         self.attachCanvas (HorizontalBarCanvas)
     else:
         self.attachCanvas (BarCanvas)
Exemple #8
0
 def __init__(self, **attr):
     """if attr.has_key ('horizontal') and attr['horizontal']:
         self.horizontal = True
         UnifiedGraph.__init__ (self, HorizontalBarCanvas, **attr)
     else:
         self.horizontal = False
         UnifiedGraph.__init__ (self, BarCanvas, **attr)"""
     UnifiedGraph.__init__(self, None, **attr)
     if self.settings.horizontal == True:
         self.attachCanvas(HorizontalBarCanvas)
     else:
         self.attachCanvas(BarCanvas)
Exemple #9
0
    def formatSettings (self, settings):
        UnifiedGraph.formatSettings (self, settings)
        
        addAttr (settings, 'markerSize', float, 2.0)
        addAttr (settings, 'markerType', str, 'circle')

        addAttr (settings, 'colorScheme', str, 'tripleAxis')
        addAttr (settings, 'color1', hex_to_color, hex_to_color ('ff0000'))
        addAttr (settings, 'color2', hex_to_color, hex_to_color ('00ff00'))
        addAttr (settings, 'color3', hex_to_color, hex_to_color ('0000ff'))
        
        addAttr (settings, 'regLineColor', hex_to_color, hex_to_color('000000'))
        addAttr (settings, 'regLineWidth', float, 1.0)
Exemple #10
0
    def formatSettings(self, settings):
        UnifiedGraph.formatSettings(self, settings)

        addAttr(settings, 'markerSize', float, 2.0)
        addAttr(settings, 'markerType', str, 'circle')

        addAttr(settings, 'colorScheme', str, 'tripleAxis')
        addAttr(settings, 'color1', hex_to_color, hex_to_color('ff0000'))
        addAttr(settings, 'color2', hex_to_color, hex_to_color('00ff00'))
        addAttr(settings, 'color3', hex_to_color, hex_to_color('0000ff'))

        addAttr(settings, 'regLineColor', hex_to_color, hex_to_color('000000'))
        addAttr(settings, 'regLineWidth', float, 1.0)
Exemple #11
0
 def createXAxisSpace (self):
     if self.settings.horizontal:
         UnifiedGraph.createXAxisSpace (self)
     else:
         h = self.settings.xAxisTextHeight
         width = []
         for child in self.canvas.data:
             if child.xml.has_key ('data') and not child.xml['data'] is None :
                 w = Text.textWidth (child.xml['data'], h)
                 width.append (w)
         if len (width) > 0:
             maxWidth = max (width)
         else:
             maxWidth = 0
         delta = self.settings.xAxisSpace + maxWidth
         self.canvas.move (0, delta)
         self.canvas.changeSize (0, -delta)
Exemple #12
0
 def createXAxisSpace(self):
     if self.settings.horizontal:
         UnifiedGraph.createXAxisSpace(self)
     else:
         h = self.settings.xAxisTextHeight
         width = []
         for child in self.canvas.data:
             if child.xml.has_key('data') and not child.xml['data'] is None:
                 w = Text.textWidth(child.xml['data'], h)
                 width.append(w)
         if len(width) > 0:
             maxWidth = max(width)
         else:
             maxWidth = 0
         delta = self.settings.xAxisSpace + maxWidth
         self.canvas.move(0, delta)
         self.canvas.changeSize(0, -delta)
Exemple #13
0
    def formatSettings (self, settings):
        UnifiedGraph.formatSettings (self, settings)
        
        addAttr (settings, 'g1MarkerType', str, 'circle')
        addAttr (settings, 'g1MarkerSize', float, '2.0')
        addAttr (settings, 'g1ColorScheme', str, 'solid')
        addAttr (settings, 'g1Color1', hex_to_color, Color (255, 0, 0))
        addAttr (settings, 'g1Color2', hex_to_color, Color (0, 255, 0))
        addAttr (settings, 'g1Color3', hex_to_color, Color (0, 0, 255))
        addAttr (settings, 'g1RegLine', boolean, False)
        addAttr (settings, 'g1RegLineColor', hex_to_color, Color (0, 0, 0))
        addAttr (settings, 'g1RegLineWidth', float, 1.0)

        addAttr (settings, 'g2MarkerType', str, 'square')
        addAttr (settings, 'g2MarkerSize', float, '4.0')
        addAttr (settings, 'g2ColorScheme', str, 'solid')
        addAttr (settings, 'g2Color1', hex_to_color, Color (0, 0, 255))
        addAttr (settings, 'g2Color2', hex_to_color, Color (0, 255, 0))
        addAttr (settings, 'g2Color3', hex_to_color, Color (255, 0, 0))
        addAttr (settings, 'g2RegLine', boolean, False)
        addAttr (settings, 'g2RegLineColor', hex_to_color, Color (0, 0, 0))
        addAttr (settings, 'g2RegLineWidth', float, 1.0)
Exemple #14
0
    def formatSettings(self, settings):
        UnifiedGraph.formatSettings(self, settings)

        addAttr(settings, 'g1MarkerType', str, 'circle')
        addAttr(settings, 'g1MarkerSize', float, '2.0')
        addAttr(settings, 'g1ColorScheme', str, 'solid')
        addAttr(settings, 'g1Color1', hex_to_color, Color(255, 0, 0))
        addAttr(settings, 'g1Color2', hex_to_color, Color(0, 255, 0))
        addAttr(settings, 'g1Color3', hex_to_color, Color(0, 0, 255))
        addAttr(settings, 'g1RegLine', boolean, False)
        addAttr(settings, 'g1RegLineColor', hex_to_color, Color(0, 0, 0))
        addAttr(settings, 'g1RegLineWidth', float, 1.0)

        addAttr(settings, 'g2MarkerType', str, 'square')
        addAttr(settings, 'g2MarkerSize', float, '4.0')
        addAttr(settings, 'g2ColorScheme', str, 'solid')
        addAttr(settings, 'g2Color1', hex_to_color, Color(0, 0, 255))
        addAttr(settings, 'g2Color2', hex_to_color, Color(0, 255, 0))
        addAttr(settings, 'g2Color3', hex_to_color, Color(255, 0, 0))
        addAttr(settings, 'g2RegLine', boolean, False)
        addAttr(settings, 'g2RegLineColor', hex_to_color, Color(0, 0, 0))
        addAttr(settings, 'g2RegLineWidth', float, 1.0)
Exemple #15
0
 def __init__ (self, **attr):
     UnifiedGraph.__init__ (self, DoubleScatterCanvas, **attr)
Exemple #16
0
 def __init__ (self, **attr):
     UnifiedGraph.__init__ (self, LineCanvas, **attr)
Exemple #17
0
 def setSVG (self):
     attr = UnifiedGraph.setSVG (self)
     return attr
Exemple #18
0
 def jsChangeTooltipPos(self):
     if not self.settings.horizontal:
         return UnifiedGraph.jsChangeTooltipPos(self)
     else:
         return """
Exemple #19
0
 def __init__(self, regLine=True, settings=None):
     UnifiedGraph.__init__(self,
                           ScatterCanvas,
                           regLine=regLine,
                           settings=settings)
Exemple #20
0
 def __init__ (self, regLine = True, settings = None):
     UnifiedGraph.__init__ (self, 
                            ScatterCanvas, 
                            regLine = regLine, 
                            settings = settings)
Exemple #21
0
 def jsChangeTooltipPos (self):
     if not self.settings.horizontal:
         return UnifiedGraph.jsChangeTooltipPos (self)
     else:
         return """
Exemple #22
0
 def setSVG(self):
     attr = UnifiedGraph.setSVG(self)
     return attr
Exemple #23
0
 def __init__(self, **attr):
     UnifiedGraph.__init__(self, DoubleScatterCanvas, **attr)
Exemple #24
0
 def __init__(self, **attr):
     UnifiedGraph.__init__(self, LineCanvas, **attr)