2013-02-24 2 views
1

내가 0 값 표시하기 위해 내 음모 공간에 추가로 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'도 될 것입니다. –

+0

@ Eric,'x.axisLineStyle'에 대한 코드를 추가했습니다. 내 차트에 축 (x, xZeroAxis, y)이 표시되지 않는 것 같습니다. 다시 볼 수 있을까요? 고맙습니다! – AlexR

+0

질문에 게시 된 코드에 문제가 표시되지 않습니다. –

답변

0

이 현재 핵심 플롯 버전에서 버그가 수 있도록 보인다 다음과 같이

enter image description here

x.axisLineStyle가 설정됩니다. 이 문제는 여기에보고되었습니다 : Core Plot Issue 514