0

我正在使用以下内容,但想根据我的计算值启动我的 x 轴,但是当我添加 visibleRange plotRangeWithLocation:CPTDecimalFromFloat(21) 时,它会从头开始消失。请帮助我。

x.majorIntervalLength = CPTDecimalFromString([NSString stringWithFormat:@"%d",(interval)]);
x.orthogonalCoordinateDecimal = CPTDecimalFromString(@"0");

x.minorTicksPerInterval = 2;

NSArray *exclusionRanges = [NSArray arrayWithObjects:
                            [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.01) length:CPTDecimalFromFloat(0.02)], 
                            [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.00) length:CPTDecimalFromFloat(0.02)],
                            [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.00) length:CPTDecimalFromFloat(0.02)],
                            nil];

x.titleLocation = CPTDecimalFromString(@"0.0");
x.labelExclusionRanges = exclusionRanges;
x.titleOffset = 10.0;

x.visibleRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0) length:CPTDecimalFromFloat(endPoint)];

谢谢,

4

1 回答 1

2

The labelExclusionRanges removes tick marks and axis labels in the given ranges. You're removing the tick at zero (0). You should just leave labelExclusionRanges at nil (its default value) if you don't need that feature.

于 2012-05-05T16:15:19.753 回答