我想在我的视图中将主要网格线与背景图像对齐,所以到目前为止我已经这样做了:
CPTXYAxisSet *axisSet = (CPTXYAxisSet *) self.hostView.hostedGraph.axisSet;
CPTAxis *x = axisSet.xAxis;
x.labelingPolicy = CPTAxisLabelingPolicyLocationsProvided;
//Other x axis config
NSMutableSet *xMajorLocations = [NSMutableSet set];
[xMajorLocations addObject:[NSNumber numberWithFloat:0.0f]];
[xMajorLocations addObject:[NSNumber numberWithFloat:341.0f]];
[xMajorLocations addObject:[NSNumber numberWithFloat:638.0f]];
x.majorTickLocations = xMajorLocations;
问题是主要位置与绘制的数据相关。有没有办法改用视图坐标?并且我想在缩放时使它们保持静止CPTAxisLabelingPolicyEqualDivisions