Changeset 3
Legend:
- Unmodified
- Added
- Removed
-
trunk/bar.py
r1 r3 7 7 8 8 class BarChart(Chart): 9 10 def __init__(self, surface=None, options={}): 11 super(BarChart, self).__init__(surface, options) 12 self.bars = [] 9 13 10 14 def render(self, surface=None, options={}): -
trunk/line.py
r2 r3 6 6 class LineChart(Chart): 7 7 8 def __init__(self, surface=None, options={}): 9 super(LineChart, self).__init__(surface, options) 10 self.points = [] 11 8 12 def render(self, surface=None, options={}): 9 13 """Renders the chart with the specified options. … … 24 28 25 29 def _evalLineChart(self): 30 """Evaluates measures for line charts""" 26 31 self.points = [] 27 32 … … 37 42 38 43 def _renderLineChart(self): 44 """Renders a line chart""" 39 45 cx = cairo.Context(self.surface) 40 46 -
trunk/pie.py
r1 r3 8 8 class PieChart(Chart): 9 9 10 def __init__(self, surface=None, options={}): 11 super(PieChart, self).__init__(surface, options) 12 self.slices = [] 13 10 14 def render(self, surface=None, options={}): 15 """Renders the chart with the specified options. 16 17 The optional parameters can be used to render a piechart in a different 18 surface with new options. 19 """ 11 20 self._evaluate(options) 12 21 self._render(surface) … … 15 24 16 25 def _evaluate(self, options): 26 """Evaluates all the data needed to plot the pie chart""" 17 27 self._eval(options) 18 28 … … 26 36 27 37 def _evalPieChart(self): 38 """Evaluates measures for pie charts""" 28 39 slices = [dict(name=key, 29 40 value=(i, value[0][1])) … … 44 55 45 56 def _renderPieChart(self): 57 """Renders a pie chart""" 46 58 cx = cairo.Context(self.surface) 47 59 cx.set_line_join(cairo.LINE_JOIN_ROUND) … … 78 90 79 91 def _evalPieTicks(self): 92 """Evaluates ticks for x and y axis""" 80 93 self.xticks = [] 81 94 … … 94 107 95 108 def _renderPieAxis(self): 109 """Renders the axis for pie charts""" 96 110 if self.options.axis.x.hide or not self.xticks: 97 111 return
