Changeset 140 for trunk/pycha/line.py
- Timestamp:
- 02/03/09 16:08:23 (3 years ago)
- Files:
-
- 1 modified
-
trunk/pycha/line.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pycha/line.py
r109 r140 1 # Copyright (c) 2007-2008by Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com>1 # Copyright(c) 2007-2009 by Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com> 2 2 # 3 3 # This file is part of PyCha. … … 18 18 from pycha.chart import Chart 19 19 from pycha.color import hex2rgb 20 20 21 21 22 class LineChart(Chart): … … 41 42 def _renderChart(self, cx): 42 43 """Renders a line chart""" 44 43 45 def preparePath(storeName): 44 46 cx.new_path() … … 48 50 # Go to the (0,0) coordinate to start drawing the area 49 51 #cx.move_to(self.area.x, self.area.y + self.area.h) 50 cx.move_to(self.area.x,51 self.area.y + (1.0 - self.area.origin) * self.area.h)52 offset = (1.0 - self.area.origin) * self.area.h 53 cx.move_to(self.area.x, self.area.y + offset) 52 54 53 55 for point in self.points: … … 79 81 cx.set_line_width(self.options.stroke.width) 80 82 if self.options.shouldFill: 83 81 84 def drawLine(storeName): 82 85 if self.options.stroke.shadow: … … 109 112 cx.restore() 110 113 114 111 115 class Point(object): 116 112 117 def __init__(self, x, y, xval, yval, name): 113 118 self.x, self.y = x, y
