Changeset 3

Show
Ignore:
Timestamp:
10/14/07 10:43:54 (5 years ago)
Author:
lgs
Message:

Add docstrings

Location:
trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/bar.py

    r1 r3  
    77 
    88class BarChart(Chart): 
     9 
     10    def __init__(self, surface=None, options={}): 
     11        super(BarChart, self).__init__(surface, options) 
     12        self.bars = [] 
    913     
    1014    def render(self, surface=None, options={}): 
  • trunk/line.py

    r2 r3  
    66class LineChart(Chart): 
    77     
     8    def __init__(self, surface=None, options={}): 
     9        super(LineChart, self).__init__(surface, options) 
     10        self.points = [] 
     11 
    812    def render(self, surface=None, options={}): 
    913        """Renders the chart with the specified options. 
     
    2428     
    2529    def _evalLineChart(self): 
     30        """Evaluates measures for line charts""" 
    2631        self.points = [] 
    2732 
     
    3742     
    3843    def _renderLineChart(self): 
     44        """Renders a line chart""" 
    3945        cx = cairo.Context(self.surface) 
    4046         
  • trunk/pie.py

    r1 r3  
    88class PieChart(Chart): 
    99 
     10    def __init__(self, surface=None, options={}): 
     11        super(PieChart, self).__init__(surface, options) 
     12        self.slices = [] 
     13 
    1014    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        """ 
    1120        self._evaluate(options) 
    1221        self._render(surface) 
     
    1524 
    1625    def _evaluate(self, options): 
     26        """Evaluates all the data needed to plot the pie chart""" 
    1727        self._eval(options) 
    1828 
     
    2636 
    2737    def _evalPieChart(self): 
     38        """Evaluates measures for pie charts""" 
    2839        slices = [dict(name=key, 
    2940                       value=(i, value[0][1])) 
     
    4455 
    4556    def _renderPieChart(self): 
     57        """Renders a pie chart""" 
    4658        cx = cairo.Context(self.surface) 
    4759        cx.set_line_join(cairo.LINE_JOIN_ROUND) 
     
    7890 
    7991    def _evalPieTicks(self): 
     92        """Evaluates ticks for x and y axis""" 
    8093        self.xticks = [] 
    8194 
     
    94107 
    95108    def _renderPieAxis(self): 
     109        """Renders the axis for pie charts""" 
    96110        if self.options.axis.x.hide or not self.xticks: 
    97111            return