I finally found the solution using custom label:
NSArray *customTickLocations = [NSArray arrayWithObjects:[NSDecimalNumber numberWithInt:0],
[NSDecimalNumber numberWithInt:5],
[NSDecimalNumber numberWithInt:10],
[NSDecimalNumber numberWithInt:15],
[NSDecimalNumber numberWithInt:20],
[NSDecimalNumber numberWithInt:25],
[NSDecimalNumber numberWithInt:30],
[NSDecimalNumber numberWithInt:35],
[NSDecimalNumber numberWithInt:40],
nil];
NSArray *xAxisLabels = [NSArray arrayWithObjects:@"15",@"18",@"21",@"0",@"3",@"6",@"9",@"12",@"15",nil];
NSUInteger labelLocation = 0;
NSMutableArray *customLabels = [NSMutableArray arrayWithCapacity:[xAxisLabels count]];
for (NSNumber *tickLocation in customTickLocations) {
CPAxisLabel *newLabel = [[CPAxisLabel alloc] initWithText: [xAxisLabels objectAtIndex:labelLocation++] textStyle:axisSet.xAxis.labelTextStyle];
newLabel.tickLocation = [tickLocation decimalValue];
newLabel.offset = axisSet.xAxis.labelOffset + axisSet.xAxis.majorTickLength;
[customLabels addObject:newLabel];
[newLabel release];
}
axisSet.xAxis.axisLabels = [NSSet setWithArray:customLabels];
Still have some thing to clarify but this is surely the way to go :)
Luc
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…