Changeset 81
- Timestamp:
- 03/21/08 13:32:34 (4 years ago)
- Location:
- trunk
- Files:
-
- 5 modified
-
examples/barchart.py (modified) (2 diffs)
-
examples/hbarchart.png (modified) (previous)
-
examples/vbarchart.png (modified) (previous)
-
src/chart.py (modified) (2 diffs)
-
src/pie.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/barchart.py
r33 r81 41 41 }, 42 42 'background': { 43 'color': '#eeeeff', 43 'chartColor': '#ffeeff', 44 'baseColor': '#ffffff', 44 45 'lineColor': '#444444' 45 46 }, … … 50 51 'padding': { 51 52 'left': 55 52 } 53 }, 54 'title': 'Sample Chart' 53 55 } 54 56 chart = chartFactory(surface, options) -
trunk/src/chart.py
r80 r81 258 258 259 259 cx.save() 260 cx.set_source_rgb(*hex2rgb(self.options.background.color)) 261 cx.rectangle(self.area.x, self.area.y, self.area.w, self.area.h) 262 cx.fill() 263 cx.set_source_rgb(*hex2rgb(self.options.background.lineColor)) 264 cx.set_line_width(self.options.axis.lineWidth) 265 266 self._renderLines(cx) 260 261 if self.options.background.baseColor: 262 cx.set_source_rgb(*hex2rgb(self.options.background.baseColor)) 263 x, y, w, h = 0, 0, self.area.w, self.area.h 264 w += self.options.padding.left + self.options.padding.right 265 h += self.options.padding.top + self.options.padding.bottom 266 cx.rectangle(x, y, w, h) 267 cx.fill() 268 269 if self.options.background.chartColor: 270 cx.set_source_rgb(*hex2rgb(self.options.background.chartColor)) 271 cx.rectangle(self.area.x, self.area.y, self.area.w, self.area.h) 272 cx.fill() 273 274 if self.options.background.lineColor: 275 cx.set_source_rgb(*hex2rgb(self.options.background.lineColor)) 276 cx.set_line_width(self.options.axis.lineWidth) 277 self._renderLines(cx) 267 278 268 279 cx.restore() … … 493 504 ), 494 505 background=Option( 495 color='#f5f5f5',496 506 hide=False, 507 baseColor=None, 508 chartColor='#f5f5f5', 497 509 lineColor='#ffffff', 498 510 lineWidth=1.5, -
trunk/src/pie.py
r66 r81 80 80 81 81 cx.save() 82 cx.set_source_rgb(*hex2rgb(self.options.background.color)) 83 cx.rectangle(self.area.x, self.area.y, self.area.w, self.area.h) 84 cx.fill() 82 83 if self.options.background.baseColor: 84 cx.set_source_rgb(*hex2rgb(self.options.background.baseColor)) 85 x, y, w, h = 0, 0, self.area.w, self.area.h 86 w += self.options.padding.left + self.options.padding.right 87 h += self.options.padding.top + self.options.padding.bottom 88 cx.rectangle(x, y, w, h) 89 cx.fill() 90 85 91 cx.restore() 86 92
