This is how I do this:
// Define some custom labels for the data elements
customTickLocations = [NSArray arrayWithObjects:
[NSDecimalNumber numberWithInt:10],
[NSDecimalNumber numberWithInt:20],
[NSDecimalNumber numberWithInt:30],
[NSDecimalNumber numberWithInt:40],
[NSDecimalNumber numberWithInt:50],
[NSDecimalNumber numberWithInt:60],
[NSDecimalNumber numberWithInt:70],
[NSDecimalNumber numberWithInt:80],
[NSDecimalNumber numberWithInt:90],
[NSDecimalNumber numberWithInt:100],
nil];
NSArray *xAxisLabels = [NSArray arrayWithObjects:@"10%", @"20%", @"30%",
@"40%", @"50%", @"60%",@"70%",@"80%",@"90%",@"100%", nil];
labelLocation = 0;
customLabels = [NSMutableArray arrayWithCapacity:[xAxisLabels count]];
for (NSNumber *tickLocation in customTickLocations) {
CPAxisLabel *newLabel = [[CPAxisLabel alloc] initWithText: [xAxisLabels objectAtIndex:labelLocation++]
textStyle:y.labelTextStyle];
newLabel.tickLocation = [tickLocation decimalValue];
newLabel.offset = y.labelOffset;
[customLabels addObject:newLabel];
//[newLabel release];
}
y.axisLabels = [NSSet setWithArray:customLabels];
y.majorTickLocations = [NSSet setWithArray:customTickLocations];
You define 2 array, one with the labels and one with the values where to put them, define "CPXAxisLabel"s and put them in another array, and this array you can put on your graph.
Hope this helps.