核心图:未显示附加轴

时间:2013-02-24 10:53:46

标签: ios objective-c cocoa-touch core-plot

我在绘图空间中添加了一个额外的x轴,以显示零值:

CPTMutableLineStyle *boldLineStyle = [xAxis.axisLineStyle mutableCopy];
boldLineStyle.lineWidth = 1;
boldLineStyle.lineColor = [CPTColor darkGrayColor];
boldLineStyle.lineCap   = kCGLineCapRound;

CPTXYAxis *xZeroAxis = [[CPTXYAxis alloc] init];
xZeroAxis.coordinate = CPTCoordinateX;
xZeroAxis.plotSpace = plotSpace;
xZeroAxis.axisLineStyle = boldLineStyle;

有趣的是,显示了此轴上的标签,但不显示轴本身:

xZeroAxis.axisLabels = [NSSet setWithArray:naLabels];
xZeroAxis.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0];
xyAxisSet.axes = @[xAxis, xLabelAxis, yAxis, xZeroAxis];

我如何更改代码以显示x轴?

谢谢!

enter image description here

x.axisLineStyle设置如下:

CPTMutableLineStyle *axisLineStyle = [CPTMutableLineStyle lineStyle];
axisLineStyle.lineWidth = 1.0;
axisLineStyle.lineCap   = kCGLineCapRound;
axisLineStyle.lineColor = [CPTColor darkGrayColor];
CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet;
CPPTXYAxis *x = axisSet.xAxis;
x.axisLineStyle = axisLineStyle;

1 个答案:

答案 0 :(得分:0)

这似乎是当前Core Plot版本中的一个错误。此处已报告此问题:Core Plot Issue 514