This is a follow up question to. Core plot-Add OutOfRange to draw graph that changes dynamically with label "OL".
I am using Automatic labelling policy and using shouldUpdateAxisLabels
and shouldUpdateMinorAxisLabels
and trying to set the OL label for whichever location is the highest.
In that method,
//Check whether need to set labelling for minTickLocations or majorTickLocations
double maxMajorTickLocationValue = [[[axis.majorTickLocations allObjects] valueForKeyPath:@"@max.doubleValue"] doubleValue];
double minMajorTickLocationValue = [[[axis.majorTickLocations allObjects] valueForKeyPath:@"@min.doubleValue"] doubleValue];
double maxMinorTickLocationValue = [[[axis.minorTickLocations allObjects] valueForKeyPath:@"@max.doubleValue"] doubleValue];
double minMinorTickLocationValue = [[[axis.minorTickLocations allObjects] valueForKeyPath:@"@min.doubleValue"] doubleValue];
while setting labels, I check if location is highest location, for e.g., if location is in majorLocations array and if its greater than maxMinorLocation and set "OL". Similarly for min value with "-OL".
Issue I am facing here is, labelling will always happen on minor locations. So for eg., in case of UI if highest location is a major location and lowest is a minor location, setting of OL label to a major location and -OL to a minor location does not work and labels will be set to only minor locations. Attaching graph image as well.
So pls suggest. /Users/shrikanth/Desktop/Screen Shot 2017-01-02 at 7.23.06 AM.png