gujjula / core-plot

Automatically exported from code.google.com/p/core-plot
0 stars 0 forks source link

Y axis title alignment is wrong when yAxis.tickDirection = CPSignPositive #275

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When yAxis.tickDirection = CPSignPositive, the y axis title is not vertically 
centered when I try to use it (by setting yAxis.title = @"..." for example).

Changing CPAxisTitle.m line 21 from :

        case CPSignNegative:
            *value -= self.offset;
            anchor = (coordinate == CPCoordinateX ? CGPointMake(0.5, 0.0) : CGPointMake(0.5, 1.0));
            break;
        case CPSignPositive:
            *value += self.offset;
            anchor = (coordinate == CPCoordinateX ? CGPointMake(0.0, 0.5) : CGPointMake(0.5, 0.0));
            break;

to :

        case CPSignNegative:
            *value -= self.offset;
            anchor = (coordinate == CPCoordinateX ? CGPointMake(0.5, 0.0) : CGPointMake(0.5, 1.0));
            break;
        case CPSignPositive:
            *value += self.offset;
            anchor = (coordinate == CPCoordinateX ? CGPointMake(*****0.5, 1.0*****) : CGPointMake(0.5, 0.0));
            break;

seems to fix my issue but I'm not sure that it does not break something else. 
What do you think ?

Thank you,
Yann.

Original issue reported on code.google.com by yann.sav...@gmail.com on 4 Apr 2011 at 2:56

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 06117973d8fc.

Original comment by eskr...@mac.com on 7 Apr 2011 at 11:51