0
코어 플롯입니다. 10 초마다 네트워크를 통해 데이터를 가져 오는 그래프를 렌더링하려고합니다. 10 초마다 가져온 데이터를 플롯하여 x.majorIntervalLength를 10으로 설정했습니다. 그러나 모든 플롯이 주요 틱에 표시되기를 기대하지만, 그것이 작동하는 방식은 아닙니다.iOS 코어 플롯 - 그래프 간격이 최대 간격까지 연장되지 않습니다.
내 x 축이 12:10:10 12:10:20 12:10:30 12:10:40이면 첫 번째 플롯은 12:10:10에 발생하지만 두 번째 것은 12 : 10시 11 분, 12시 10 분 12 초에 세 번째. 두 번째와 세 번째 플롯 기호가 12:10:20과 12:10:30에 나타나기를 기대합니다. 왜냐하면 데이터가 백엔드에서 꺼내지기 때문입니다.
가 여기 내 x 축 구성입니다 :
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init] ;
[dateFormatter setDateFormat:@" HH:mm:ss\rYYYY.MM.dd"];
[dateFormatter setTimeZone:[NSTimeZone systemTimeZone]];
CPTTimeFormatter *dateTimeFormatterForXAxis = [[CPTTimeFormatter alloc] initWithDateFormatter:dateFormatter] ;
dateTimeFormatterForXAxis.referenceDate = [NSDate date];
CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet;
CPTXYAxis *x = axisSet.xAxis;
x.labelFormatter = dateTimeFormatterForXAxis;
x.minorTicksPerInterval = 0;
x.majorIntervalLength = @10;
내가 무슨 말이냐?
좋습니다.
포인터 주셔서 감사합니다. Eric. 축 인덱스를 적절하게 곱해서 작동합니다. – user3012653