The axis is drawn according to the graph in a curve
I have a graph and I want to add two blue axes to this graph, in addition to the x-axis and the y-axis. However, these blue axes appear below the plot. Any idea how to get the blue axes over the top of the plot? Thank you in advance.
blueAxisList = [[NSMutableDictionary alloc] init];
CPTXYAxis *blueAxis = [blueAxisList objectForKey:name];
blueAxis = [[CPTXYAxis alloc] init];
blueAxis.coordinate = CPTCoordinateX;
blueAxis.plotSpace = plotSpace;
CPTMutableLineStyle *lineStyle = [CPTMutableLineStyle lineStyle];
lineStyle.lineWidth = 3.f;
blueAxis.axisLineStyle = lineStyle;
blueAxis.minorTickLineStyle = nil;
blueAxis.majorTickLineStyle = nil;
blueAxis.labelingPolicy = CPTAxisLabelingPolicyNone;
// Line cap on lhs
CPTLineCap *lineCap = [CPTLineCap lineCap];
lineCap.size = CGSizeMake(8., 60.);
lineCap.lineStyle = lineStyle;
lineCap.lineCapType = CPTLineCapTypeRectangle;
const double axisLength = plotSpace.xRange.lengthDouble;
blueAxis.visibleAxisRange = [CPTPlotRange plotRangeWithLocation:plotSpace.xRange.location length:CPTDecimalFromDouble(axisLength)];
blueAxis.axisLineCapMax = lineCap;
NSMutableArray *axesList= [graph.axisSet.axes mutableCopy];
[axesList addObject: blueAxis];
graph.axisSet.axes = axesList;
0
source to share