2012-08-16 3 views
2

Y 축에 10 개의 메이저 틱만 가져 오려고합니다. 그 때문에 나는 방법 preferredNumberOfMajorTicks = 10을 사용하고 있습니다. Core-Plot - preferredNumberOfMajorTicks는 틱의 수를 제한하지 않습니다.

하지만 스크린 샷에서 볼 수 있듯이, 정말 작동하지 않습니다

는 ... 여기

bad Y axis ticks

는 y 축에 대한 내 구성입니다 :

CPTXYAxis *y = axisSet.yAxis; 
y.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; 
//y.majorIntervalLength = CPTDecimalFromDouble(2); 
y.preferredNumberOfMajorTicks = 10; 
y.minorTicksPerInterval = 5; 
y.tickDirection = CPTSignNone; 
y.majorTickLineStyle = majorLineStyle; 
y.minorTickLineStyle = minorLineStyle; 
y.axisLineStyle = majorLineStyle; 
y.majorTickLength = 7.0; 
y.minorTickLength = 5.0; 
y.labelTextStyle = whiteTextStyle; 
y.minorTickLabelTextStyle = minorTickBlackTextStyle; 
y.titleTextStyle = whiteTextStyle; 

y.axisConstraints = [CPTConstraints constraintWithLowerOffset:40.0]; 

뭔가해야 이상 오른쪽 methode preferredNumberOfMajorTicks = 10 그러나 나는 무엇을 볼 수 없습니다 ...

답변

7

preferredNumberOfMajorTicks 속성은 고정 된 것에 적용되지 않습니다. 간격 레이블 지정 정책. 자세한 내용은 Core Plot docs을 참조하십시오.

  1. 가 고정 간격 라벨링 정책을 유지하고 진드기의 수를 줄 것이다 값으로 majorIntervalLength을 변경 : 현재 두 가지 옵션이 있습니다.

  2. 레이블 지정 정책을 CPTAxisLabelingPolicyAutomatic 또는 CPTAxisLabelingPolicyEqualDivisions으로 변경하십시오.

+0

그것은 해결책이었습니다. 지금은 분명합니다. 빠른 답변 주셔서 감사합니다. Eric –

관련 문제