Changeset 99
- Timestamp:
- 09/12/08 11:56:59 (4 years ago)
- Files:
-
- 1 modified
-
trunk/src/chart.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/chart.py
r98 r99 413 413 cx.show_text(label) 414 414 415 def _renderYAxis(self, cx): 416 """Draws the vertical line represeting the Y axis""" 417 cx.new_path() 418 cx.move_to(self.area.x, self.area.y) 419 cx.line_to(self.area.x, self.area.y + self.area.h) 420 cx.close_path() 421 cx.stroke() 422 423 def _renderXAxis(self, cx): 424 """Draws the horizontal line representing the X axis""" 425 cx.new_path() 426 cx.move_to(self.area.x, self.area.y + self.area.h) 427 cx.line_to(self.area.x + self.area.w, self.area.y + self.area.h) 428 cx.close_path() 429 cx.stroke() 430 415 431 def _renderAxis(self, cx): 416 432 """Renders axis""" … … 430 446 cx.save() 431 447 rotate = self.options.axis.y.rotate 432 tickWidth, tickHeight = self._getTickSize(cx, self.yticks, rotate) 448 tickWidth, tickHeight = self._getTickSize(cx, self.yticks, 449 rotate) 433 450 label = unicode(self.options.axis.y.label) 434 451 x = self.area.x - tickWidth - 4.0 435 452 y = self.area.y + 0.5 * self.area.h 436 self._renderAxisLabel(cx, tickWidth, tickHeight, label, x, y, True) 453 self._renderAxisLabel(cx, tickWidth, tickHeight, label, x, y, 454 True) 437 455 cx.restore() 438 456 439 # draws the vertical line representing the Y axis 440 cx.new_path() 441 cx.move_to(self.area.x, self.area.y) 442 cx.line_to(self.area.x, self.area.y + self.area.h) 443 cx.close_path() 444 cx.stroke() 457 self._renderYAxis(cx) 445 458 446 459 if not self.options.axis.x.hide: … … 453 466 cx.save() 454 467 rotate = self.options.axis.x.rotate 455 tickWidth, tickHeight = self._getTickSize(cx, self.xticks, rotate) 468 tickWidth, tickHeight = self._getTickSize(cx, self.xticks, 469 rotate) 456 470 label = unicode(self.options.axis.x.label) 457 471 x = self.area.x + self.area.w / 2.0 458 472 y = self.area.y + self.area.h + tickHeight + 4.0 459 self._renderAxisLabel(cx, tickWidth, tickHeight, label, x, y, False) 473 self._renderAxisLabel(cx, tickWidth, tickHeight, label, x, y, 474 False) 460 475 cx.restore() 461 476 462 # draws the horizontal line representing the X axis 463 cx.new_path() 464 cx.move_to(self.area.x, self.area.y + self.area.h) 465 cx.line_to(self.area.x + self.area.w, self.area.y + self.area.h) 466 cx.close_path() 467 cx.stroke() 477 self._renderXAxis(cx) 468 478 469 479 cx.restore()
