我想添加多个x轴,我的代码如下:
CPTXYAxisSet *axisSet = (CPTXYAxisSet *)barChart.axisSet;
/// Here I customize default x and y axis. And they are correctly visible
// Now create additional x axis
CPTXYAxis *bottomX = [[CPTXYAxis alloc]init];
bottomX.orthogonalCoordinateDecimal = CPTDecimalFromString(@"4");
CPTMutableLineStyle * lineStyle = [CPTMutableLineStyle lineStyle];
lineStyle.lineWidth = 3.0f;
lineStyle.lineColor = [CPTColor greenColor];
lineStyle.dashPattern = [NSArray arrayWithObjects:[NSNumber numberWithFloat:5.0f], [NSNumber numberWithFloat:5.0f], nil];
bottomX.axisLineStyle = lineStyle;
NSMutableArray * axes=[NSMutableArray arrayWithArray:axisSet.axes];
[axes addObject:bottomX];
axisSet.axes=axes;
默认的 x,y 轴是完美的,但附加的 x 轴 (bottomX) 没有显示任何位置。