Вопрос

I have my y axis range from -0.1 to 2.5 and want the y axis labels to be 0.0, 0.4, 0.8, 1.2, 1.6, 2.0.

Currently this is what I have

newPlotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(-0.1) length:CPTDecimalFromFloat(2.6)];

CPTXYAxis *y = [[CPTXYAxis alloc] init];
y.labelingPolicy = CPTAxisLabelingPolicyFixedInterval;
y.majorIntervalLength = CPTDecimalFromDouble(0.4);

But the above code also displays the label y = 2.4. I do not want 2.4 to be displayed on the y axis. Any suggestions as to how I can do this.

Это было полезно?

Решение

Either use the CPTAxisLabelingPolicyLocationsProvided labeling policy and set the tick locations you want or set the labelExclusionRanges to skip the label at 2.4.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top