开发者

Date on x axis iphone using core plot

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;


Don't forget to set intervalLength

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜