0
votes

I want to show data on x-axis on CPXYPlotSpace. I have seen doing so on mac using something like that but it does not work on iphone so any suggestion or i have to do it manually.

 NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
dateFormatter.dateStyle = kCFDateFormatterShortStyle;
CPTimeFormatter *timeFormatter = [[[CPTimeFormatter alloc] initWithDateFormatter:dateFormatter] autorelease];
timeFormatter.referenceDate = refDate;
x.labelFormatter = timeFormatter;
1

1 Answers

0
votes

Don't forget to set intervalLength

    NSTimeInterval oneDay = 24 * 60 * 60;
x.majorIntervalLength = CPDecimalFromFloat(oneDay);
y.orthogonalCoordinateDecimal = CPDecimalFromFloat(oneDay);