When you create your axis set the labelling policy to CPTAxisLabelingPolicyAutomatic
. For example,
CPTXYAxis *x = [[CPTXYAxis alloc] init];
x.coordinate = CPTCoordinateX;
x.labelingPolicy = CPTAxisLabelingPolicyAutomatic;
// ...
This will automatically determine a sensible number and location for your axis labels.