【发布时间】:2015-06-22 15:52:12
【问题描述】:
我有一个使用 CorePlot 的散点图。对于 Y 轴,我在提供的刻度线之间有自定义间隔。
yAxis.labelingPolicy = CPTAxisLabelingPolicyLocationsProvided;
NSArray *labels = [NSArray arrayWithObjects:@"100",@"280",@"360",@"860",@"910",nil];
NSMutableSet *amountLabels = [NSMutableSet set];
NSMutableSet *majorTickLocations = [NSMutableSet set];
[creditScores
enumerateObjectsUsingBlock:
^(NSString *amount, NSUInteger index, BOOL *stop)
{
CPTAxisLabel *label = [[CPTAxisLabel alloc] initWithText:score textStyle:[self defaultTextStyle]];
NSNumber *location = [NSNumber numberWithFloat:[amount floatValue]];
[majorTickLocations addObject:location];
label.tickLocation = CPTDecimalFromCGFloat([location floatValue]);
[amountLabels addObject:label];
}];
yAxis.majorTickLocations = majorTickLocations;
yAxis.axisLabels = amountLabels;
我想调整每个刻度线之间的物理距离(以点或像素为单位)。我想要的设计不会按比例正确。有没有办法设置或定义每个刻度线之间的距离?
【问题讨论】: