# HG changeset patch # User Paul Boddie # Date 1318106161 -7200 # Node ID 87eb40178c3cd093a651c8d5288b01046ef36437 # Parent 83154b6d9de71d553d2d412ed79c0c0d4e9fd2ee Fixed the axis label positioning which previously tested and used the positions of the wrong axis for each label. diff -r 83154b6d9de7 -r 87eb40178c3c SVGChartSupport.py --- a/SVGChartSupport.py Sun May 29 01:54:00 2011 +0200 +++ b/SVGChartSupport.py Sat Oct 08 22:36:01 2011 +0200 @@ -265,18 +265,22 @@ def get_labelled_point(plot, x_axis, y_axis, x, y, r, text, offset_x, offset_y, font_height, y_axis_label="", x_axis_label="", axis_label_x=0, axis_label_y=0, attributes=None): - if x > x_axis.position: - axis_label_x = x_axis.position - axis_label_x + # Remember that the y-axis position is a horizontal/x co-ordinate. + + if x > y_axis.position: + axis_label_x = y_axis.position - axis_label_x y_axis_label_class = "west" else: - axis_label_x = x_axis.position + axis_label_x + axis_label_x = y_axis.position + axis_label_x y_axis_label_class = "east" - if y > y_axis.position: - axis_label_y = y_axis.position - axis_label_y + # Remember that the x-axis position is a vertical/y co-ordinate. + + if y > x_axis.position: + axis_label_y = x_axis.position - axis_label_y x_axis_label_class = "south" else: - axis_label_y = y_axis.position + axis_label_y + axis_label_y = x_axis.position + axis_label_y x_axis_label_class = "north" circle = plot.get_point(x, y, r, attributes)