Changeset 140 for trunk/pycha/bar.py
- Timestamp:
- 02/03/09 16:08:23 (3 years ago)
- Files:
-
- 1 modified
-
trunk/pycha/bar.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pycha/bar.py
r112 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, uniqueIndices 19 19 from pycha.color import hex2rgb 20 20 21 21 22 class BarChart(Chart): … … 96 97 drawBar(bar) 97 98 cx.restore() 99 98 100 99 101 class VerticalBarChart(BarChart): … … 138 140 xval, yval = item 139 141 y = (((xval - self.minxval) * self.xscale) 140 + self.barMargin + (i * self.barWidthForSet))142 + self.barMargin + (i * self.barWidthForSet)) 141 143 h = self.barWidthForSet 142 144 w = abs(yval) * self.yscale … … 155 157 offset = (self.minxdelta * self.xscale) / 2 156 158 tmp = self.xticks 157 self.xticks = [(1.0 - tick[0], tick[1]) for tick in self.yticks ]159 self.xticks = [(1.0 - tick[0], tick[1]) for tick in self.yticks] 158 160 self.yticks = [(tick[0] + offset, tick[1]) for tick in tmp] 159 161 … … 185 187 cx.stroke() 186 188 189 187 190 class Rect(object): 191 188 192 def __init__(self, x, y, w, h, xval, yval, name): 189 193 self.x, self.y, self.w, self.h = x, y, w, h
