嗨,我正在使用核心图创建一个图形,我想更改主要和次要线的线条样式,线条样式已更改,但我们在核心图中有两条主要线顶部和底部线 如何删除顶部主要线
- (void) setupGraphAxis: (CPTXYGraph *) graph {
CPTColor *axisColor = [CPTColor colorWithComponentRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:0.75];
CPTMutableLineStyle *axisLineStyle = [CPTMutableLineStyle lineStyle];
axisLineStyle.lineWidth = 1.5f;
axisLineStyle.lineColor = axisColor;
CPTMutableLineStyle *dashLineStyle = [CPTMutableLineStyle lineStyle];
dashLineStyle.lineColor = axisColor;
dashLineStyle.lineWidth = 1.5f;
dashLineStyle.dashPattern = [NSArray arrayWithObjects:[NSDecimalNumber numberWithInt:1],[NSDecimalNumber numberWithInt:2],nil];
dashLineStyle.patternPhase = 0.0f;
CPTMutableLineStyle *fullLineStyle = [CPTMutableLineStyle lineStyle];
fullLineStyle.lineColor = axisColor;
fullLineStyle.lineWidth = 1.5f;
//fullLineStyle.dashPattern = [NSArray arrayWithObjects:[NSDecimalNumber numberWithInt:1],nil];
fullLineStyle.lineCap = 0;
fullLineStyle.patternPhase = 0.0f;
//Configure x-axis
CPTXYAxisSet *axisSet = (CPTXYAxisSet *) graph.axisSet;
CPTXYAxis *x = axisSet.xAxis;
x.axisLineStyle = nil;
x.orthogonalCoordinateDecimal = CPTDecimalFromString(@"0");
x.minorTickLineStyle = nil;
x.majorTickLineStyle = nil;
CPTAxisLabelingPolicy policy = CPTAxisLabelingPolicyAutomatic;
x.labelingPolicy = policy;
x.labelTextStyle = nil;
x.preferredNumberOfMajorTicks = 1;
CPTXYAxis *y = axisSet.yAxis;
y.axisLineStyle = nil;
y.orthogonalCoordinateDecimal = CPTDecimalFromString(@"0");
y.minorTickLineStyle = nil;
y.majorTickLineStyle = nil;
y.majorGridLineStyle = fullLineStyle;
y.minorGridLineStyle = dashLineStyle;
y.labelingPolicy = policy;
y.preferredNumberOfMajorTicks = 1;
}