Пример #1
0
 def renderLayer(self):
     render_utils.setDynamicSource(self.context, self.scheme['color'])
     self.scheme['font'].style['align'] = 'center' # override user settings
     self.scheme['font'].render(
         self.content, 
         (self.position[0], self.position[1] + self.scheme['margin-top'])
     )
Пример #2
0
 def renderLayer(self):
     render_utils.setDynamicSource(self.context, '#000000')
     for i, category in enumerate(self.values):
         y_position = self.y_axis.positionOfValue(category[0])[1]
         x_position = self.x_axis.positionOfValue(category.title)[0]
         if i == 0:
             self.context.move_to(x_position, y_position)
         self.context.line_to(x_position, y_position)
     self.context.stroke()
Пример #3
0
    def __renderBorder(self):
        self.context.save()
        self.context.set_antialias(1)
        self.context.set_line_width(self.scheme['border']['stroke-thickness'])
        render_utils.setDynamicSource(self.context, self.scheme['border']['color'])

        if self.orientation == 'horizontal':
            self.context.move_to(*self.borderOrigin)
            self.context.line_to(self.borderOrigin[0] + self.length, \
                self.borderOrigin[1])

        elif self.orientation == 'vertical':
            self.context.move_to(*self.borderOrigin)
            self.context.line_to(self.borderOrigin[0], \
                self.borderOrigin[1] - self.length)

        self.context.stroke()
        self.context.restore()
Пример #4
0
        def renderLayer(self):
            offset = 0
            if len(self.values) > 1:
                offset =  self.seriesGap / (len(self.values) - 1)
            cumulative_gap_width = self.seriesGap * (len(self.values) - 1) - offset
            position = self.position[0] + self.edgeSpacing - cumulative_gap_width, self.position[1]

            for i, value in enumerate(self.values):
                v_position = self.y_axis.positionOfValue(value)[1]

                if i > 0:
                    x = position[0] + (i * (self.seriesGap + self.seriesWidth))
                else:
                    x = position[0] + (i * self.seriesWidth)

                self.context.rectangle(
                    x,
                    v_position,
                    self.seriesWidth,
                    self.zero_pos - v_position
                )
                if callable(self.manager.scheme['series']['color']):
                    render_utils.setDynamicSource(
                        self.context,
                        self.manager.scheme['series']['color'],
                        {'value': value, 'loop': i, 'position': v_position}
                    )
                else:
                    try:
                        render_utils.setDynamicSource(
                            self.context,
                            self.manager.scheme['series']['color'][i]
                        )
                    except:
                        raise render_utils.RenderError('Color index out of range.')
                #self.context.stroke()
                self.context.fill()
Пример #5
0
 def renderLayer(self):
     render_utils.setDynamicSource(self.context, self.scheme['color'])
     self.context.paint()
Пример #6
0
 def initRendering(self):
     self.context.set_antialias(1)
     render_utils.setDynamicSource(self.context, self.scheme["color"])
Пример #7
0
 def initRendering(self):
     self.context.set_antialias(1)
     self.context.set_line_width(self.scheme["stroke-thickness"])
     render_utils.setDynamicSource(self.context, self.scheme["color"])