2013-10-25 6 views
0

I 가중치 대 유닉스 타임 스탬프를 플로팅하고, 따라서 내 X 축 범위 축, 예를 들어,이다 1380330622 1382696991 통해코어 플롯 어려움

Y 축이다 : (83)를 통해 86 정도 ...

40 개의 항목이 있습니다.

내 플롯 범위는 기본적으로 최소 <로 설정되어

- 각각의> 최대, 그리고 ... 그래프 데이터가 잘 나타납니다 ...하지만 내 축이 전혀 표시 얻을 수 없습니다

초기 높은 X 축의 번호는 주 눈금의 큰 숫자가 할당되게 하였다 해결 이잖아 있지만 축 : 여기

enter image description here

-(void)configureAxis{ 


    graph.plotAreaFrame.axisSet.borderLineStyle = [CPTLineStyle lineStyle]; 

    // Line styles 
    CPTMutableLineStyle *axisLineStyle = [CPTMutableLineStyle lineStyle]; 
    axisLineStyle.lineWidth = 3.0; 
    axisLineStyle.lineCap = kCGLineCapRound; 

    CPTMutableLineStyle *majorGridLineStyle = [CPTMutableLineStyle lineStyle]; 
    majorGridLineStyle.lineWidth = 0.75; 
    majorGridLineStyle.lineColor = [CPTColor redColor]; 

    CPTMutableLineStyle *minorGridLineStyle = [CPTMutableLineStyle lineStyle]; 
    minorGridLineStyle.lineWidth = 0.25; 
    minorGridLineStyle.lineColor = [CPTColor blueColor]; 

    // Text styles 
    CPTMutableTextStyle *axisTitleTextStyle = [CPTMutableTextStyle textStyle]; 
    axisTitleTextStyle.fontName = @"Helvetica Bold"; 
    axisTitleTextStyle.fontSize = 14.0; 

    // Axes 
    // Label x axis with a fixed interval policy 
    CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet; 
    CPTXYAxis *x   = axisSet.xAxis; 
    x.separateLayers    = NO; 
    x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(82.0f); 
    x.majorIntervalLength   = CPTDecimalFromString(@"86400"); 
    x.minorTicksPerInterval  = 4; 
    x.tickDirection    = CPTSignNone; 
    x.axisLineStyle    = axisLineStyle; 
    x.majorTickLength    = 12.0; 
    x.majorTickLineStyle   = axisLineStyle; 
    x.majorGridLineStyle   = majorGridLineStyle; 
    x.minorTickLength    = 8.0; 
    x.minorGridLineStyle   = minorGridLineStyle; 
    x.title      = @"Date"; 
    x.titleTextStyle    = axisTitleTextStyle; 
    x.titleOffset     = 25.0; 
    x.labelingPolicy    = CPTAxisLabelingPolicyAutomatic; 


    // Label y axis with a fixed interval policy 
    CPTXYAxis *y   = axisSet.yAxis; 
    y.separateLayers    = NO; 
    y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(1380340622.0f); 
    y.majorIntervalLength   = CPTDecimalFromString(@"10"); 
    y.minorTicksPerInterval  = 4; 
    y.tickDirection    = CPTSignNone; 
    y.axisLineStyle    = axisLineStyle; 
    y.majorTickLength    = 12.0; 
    y.majorTickLineStyle   = axisLineStyle; 
    y.majorGridLineStyle   = majorGridLineStyle; 
    y.minorTickLength    = 8.0; 
    y.minorGridLineStyle   = minorGridLineStyle; 
    y.title      = @"Weight in kg"; 
    y.titleTextStyle    = axisTitleTextStyle; 
    y.titleOffset     = 25.0; 
    y.labelingPolicy    = CPTAxisLabelingPolicyAutomatic; 





} 

는 numberforplot와 전류 출력 없음

,
2013-10-26 11:13:04.509 app[2174:303] The size of the arays for x and y are: 41;41 
2013-10-26 11:13:04.509 app[2174:303] XMIN: 111667.172778 XMAX: 112324.4975 
2013-10-26 11:13:04.509 app[2174:303] YMIN: 83.225 YMAX: 85.701 
2013-10-26 11:13:04.509 app[2174:303] Data dictionary: { 
    identifier = WEIGHT; 
    "max_x" = "112324.4975"; 
    "max_y" = "85.701"; 
    "min_x" = "111667.172778"; 
    "min_y" = "83.225"; 
    "x_values" =  (
     "111667.172778", 
     "111732.579167", 
     "111732.931944", 
     "111733.087222", 
     "111748.680278", 
     "111757.177778", 
     "111760.608056", 
     "111763.109444", 
     "111763.497222", 
     "111763.529167", 
     "111763.678056", 
     "111764.11", 
     "111772.890556", 
     "111773.146389", 
     "111779.491389", 
     "111785.4075", 
     "111796.832778", 
     "111821.3", 
     "111846.429722", 
     "111869.016389", 
     "111892.786389", 
     "111916.811111", 
     "111941.981944", 
     "111942.026389", 
     "111965.135833", 
     "111989.396667", 
     "112012.848611", 
     "112038.682778", 
     "112061.785", 
     "112085.694444", 
     "112109.053056", 
     "112131.653889", 
     "112157.381111", 
     "112181.126944", 
     "112205.423056", 
     "112205.711111", 
     "112229.128056", 
     "112252.898611", 
     "112276.948889", 
     "112300.449167", 
     "112324.4975" 
    ); 
    "y_values" =  (
     "83.823", 
     "84.286", 
     "83.807", 
     "84.387", 
     "83.256", 
     "84.799", 
     "85.005", 
     "85.399", 
     "85.414", 
     "85.595", 
     "85.701", 
     "85.493", 
     "84.427", 
     "83.989", 
     "84.462", 
     "85.134", 
     "83.797", 
     "83.454", 
     "83.87", 
     "83.526", 
     "83.512", 
     "83.969", 
     "84.02", 
     "84.009", 
     "85.13", 
     "84.662", 
     "83.869", 
     "84.5", 
     "83.94", 
     "83.225", 
     "84.352", 
     "84.332", 
     "83.617", 
     "83.776", 
     "84.582", 
     "83.869", 
     "83.712", 
     "84.144", 
     "84.048", 
     "84.035", 
     "84.06" 
    ); 
} 
2013-10-26 11:13:04.511 app[2174:303] Adding plot to graph system 
2013-10-26 11:13:04.511 app[2174:303] Added... 1 
2013-10-26 11:13:04.512 app[2174:303] Number of entries... 41 
2013-10-26 11:13:04.512 app[2174:303] Number of entries... 41 
2013-10-26 11:13:04.512 app[2174:303] 0,111667.172778 
2013-10-26 11:13:04.513 app[2174:303] 1,111732.579167 
2013-10-26 11:13:04.513 app[2174:303] 2,111732.931944 
2013-10-26 11:13:04.513 app[2174:303] 3,111733.087222 
2013-10-26 11:13:04.513 app[2174:303] 4,111748.680278 
2013-10-26 11:13:04.513 app[2174:303] 5,111757.177778 
2013-10-26 11:13:04.514 app[2174:303] 6,111760.608056 
2013-10-26 11:13:04.514 app[2174:303] 7,111763.109444 
2013-10-26 11:13:04.514 app[2174:303] 8,111763.497222 
2013-10-26 11:13:04.514 app[2174:303] 9,111763.529167 
2013-10-26 11:13:04.515 app[2174:303] 10,111763.678056 
2013-10-26 11:13:04.515 app[2174:303] 11,111764.11 
2013-10-26 11:13:04.515 app[2174:303] 12,111772.890556 
2013-10-26 11:13:04.515 app[2174:303] 13,111773.146389 
2013-10-26 11:13:04.515 app[2174:303] 14,111779.491389 
2013-10-26 11:13:04.516 app[2174:303] 15,111785.4075 
2013-10-26 11:13:04.516 app[2174:303] 16,111796.832778 
2013-10-26 11:13:04.516 app[2174:303] 17,111821.3 
2013-10-26 11:13:04.516 app[2174:303] 18,111846.429722 
2013-10-26 11:13:04.516 app[2174:303] 19,111869.016389 
2013-10-26 11:13:04.517 app[2174:303] 20,111892.786389 
2013-10-26 11:13:04.517 app[2174:303] 21,111916.811111 
2013-10-26 11:13:04.517 app[2174:303] 22,111941.981944 
2013-10-26 11:13:04.517 app[2174:303] 23,111942.026389 
2013-10-26 11:13:04.517 app[2174:303] 24,111965.135833 
2013-10-26 11:13:04.518 app[2174:303] 25,111989.396667 
2013-10-26 11:13:04.518 app[2174:303] 26,112012.848611 
2013-10-26 11:13:04.518 app[2174:303] 27,112038.682778 
2013-10-26 11:13:04.518 app[2174:303] 28,112061.785 
2013-10-26 11:13:04.518 app[2174:303] 29,112085.694444 
2013-10-26 11:13:04.518 app[2174:303] 30,112109.053056 
2013-10-26 11:13:04.519 app[2174:303] 31,112131.653889 
2013-10-26 11:13:04.519 app[2174:303] 32,112157.381111 
2013-10-26 11:13:04.519 app[2174:303] 33,112181.126944 
2013-10-26 11:13:04.519 app[2174:303] 34,112205.423056 
2013-10-26 11:13:04.519 app[2174:303] 35,112205.711111 
2013-10-26 11:13:04.520 app[2174:303] 36,112229.128056 
2013-10-26 11:13:04.520 app[2174:303] 37,112252.898611 
2013-10-26 11:13:04.520 app[2174:303] 38,112276.948889 
2013-10-26 11:13:04.520 app[2174:303] 39,112300.449167 
2013-10-26 11:13:04.520 app[2174:303] 40,112324.4975 
2013-10-26 11:13:04.521 app[2174:303] Number of entries... 41 
2013-10-26 11:13:04.521 app[2174:303] 0,83.823 
2013-10-26 11:13:04.521 app[2174:303] 1,84.286 
2013-10-26 11:13:04.522 app[2174:303] 2,83.807 
2013-10-26 11:13:04.522 app[2174:303] 3,84.387 
2013-10-26 11:13:04.522 app[2174:303] 4,83.256 
2013-10-26 11:13:04.522 app[2174:303] 5,84.799 
2013-10-26 11:13:04.522 app[2174:303] 6,85.005 
2013-10-26 11:13:04.523 app[2174:303] 7,85.399 
2013-10-26 11:13:04.523 app[2174:303] 8,85.414 
2013-10-26 11:13:04.523 app[2174:303] 9,85.595 
2013-10-26 11:13:04.523 app[2174:303] 10,85.701 
2013-10-26 11:13:04.523 app[2174:303] 11,85.493 
2013-10-26 11:13:04.524 app[2174:303] 12,84.427 
2013-10-26 11:13:04.524 app[2174:303] 13,83.989 
2013-10-26 11:13:04.524 app[2174:303] 14,84.462 
2013-10-26 11:13:04.524 app[2174:303] 15,85.134 
2013-10-26 11:13:04.524 app[2174:303] 16,83.797 
2013-10-26 11:13:04.525 app[2174:303] 17,83.454 
2013-10-26 11:13:04.525 app[2174:303] 18,83.87 
2013-10-26 11:13:04.525 app[2174:303] 19,83.526 
2013-10-26 11:13:04.525 app[2174:303] 20,83.512 
2013-10-26 11:13:04.526 app[2174:303] 21,83.969 
2013-10-26 11:13:04.526 app[2174:303] 22,84.02 
2013-10-26 11:13:04.526 app[2174:303] 23,84.009 
2013-10-26 11:13:04.526 app[2174:303] 24,85.13 
2013-10-26 11:13:04.526 app[2174:303] 25,84.662 
2013-10-26 11:13:04.526 app[2174:303] 26,83.869 
2013-10-26 11:13:04.527 app[2174:303] 27,84.5 
2013-10-26 11:13:04.527 app[2174:303] 28,83.94 
2013-10-26 11:13:04.527 app[2174:303] 29,83.225 
2013-10-26 11:13:04.527 app[2174:303] 30,84.352 
2013-10-26 11:13:04.528 app[2174:303] 31,84.332 
2013-10-26 11:13:04.528 app[2174:303] 32,83.617 
2013-10-26 11:13:04.528 app[2174:303] 33,83.776 
2013-10-26 11:13:04.528 app[2174:303] 34,84.582 
2013-10-26 11:13:04.528 app[2174:303] 35,83.869 
2013-10-26 11:13:04.529 app[2174:303] 36,83.712 
2013-10-26 11:13:04.529 app[2174:303] 37,84.144 
2013-10-26 11:13:04.529 app[2174:303] 38,84.048 
2013-10-26 11:13:04.529 app[2174:303] 39,84.035 
2013-10-26 11:13:04.529 app[2174:303] 40,84.06 
2013-10-26 11:13:04.530 app[2174:303] Number of entries... 41 

답변

0

이 문제의 적어도 일부입니다 CPTDecimalFromDouble(1380340622.0f);

그 숫자는 (이하 "F"접미사에 의해 강제) float 값으로 정확하게 표현하기에 너무 큽니다. 유닉스 시간은 너무 이런 식으로 뭔가를 시도, 정수 :

귀하의 축 위치가 데이터의 범위 밖에 : 질문의 새로운 정보를 기반으로

y.orthogonalCoordinateDecimal = CPTDecimalFromLong(1380330622); 

편집. 예를 들어 x 축은 y = 82.0에서 y 축과 교차하지만 플롯 범위는 83.225에서 시작합니다. 당신은 항상 플롯 영역의 특정 지점에 축을 고정하려면

x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(y_min); 
y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(x_min); 

(예를 들어, 가장자리 또는 중간 중 하나)에 관계없이 눈에 보이는 데이터의 범위를 대신 축 제약 조건을 사용할 수 있습니다 직교 좌표.

x.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0]; 
y.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0]; 
+0

고마워요. 아직 해결하지 못했습니다. 축 : -/ – JeremyLaurenson

+0

x 및 y 범위는 무엇입니까? 데이터 소스가 타임 스탬프 또는 x 값의 인덱스를 반환합니까? –

+0

타임 스탬프를 정수로 변환합니다. 나는 또한 2000 년 이래로 시간을 계산하여 숫자가 훨씬 적습니다. 위에 표시된 원래 범위 – JeremyLaurenson