2013-02-24 180 views
1

我增加了一個額外的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軸?

謝謝!

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; 
+0

什麼是'xAxis.axisLineStyle'?如果它是'nil','boldLineStyle'也是。 – 2013-02-24 22:08:30

+0

@Eric,我添加了'x.axisLineStyle'的代碼。看起來我的圖表沒有顯示任何座標軸(x,xZeroAxis,y)。你能再看一遍嗎?謝謝! – AlexR 2013-02-25 13:35:26

+0

我沒有看到問題中發佈的代碼中的任何問題。 – 2013-02-26 01:33:47

回答

0

這似乎是當前的核心情節釋放了一個錯誤:

enter image description here

x.axisLineStyle設定如下。這個問題已經在這裏報道:Core Plot Issue 514