【发布时间】:2014-01-23 21:30:35
【问题描述】:
我想在我的视图中将主要网格线与背景图像对齐,所以到目前为止我已经这样做了:
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 一样缩放时,我想让它们保持静止@
【问题讨论】:
-
你可以在背景图片中添加线条吗?
-
我可以,但他们不会喜欢 x 轴标签,对吧?