我發現Tapku圖http://duivesteyn.net/2010/03/07/iphone-sdk-implementing-the-tapku-graph-in-your-application/?utm_source=twitterfeed&utm_medium=twitteriPhone Tapku圖,我如何使用日期而不是數字?
...這看起來很酷且相當簡單實現
- (void) thread{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
srand([[NSDate date] timeIntervalSince1970]);
for(int i=0;i<100;i++){
//int no = rand() % 100 + i;
int no = 10 + i;
//I've changed the above value to prove that heres
//where you supply your data
GraphPoint *gp = [[GraphPoint alloc] initWithID:i value:[NSNumber numberWithFloat:no]];
[data addObject:gp];
[gp release];
}
//Heres where the data is drawn
- (void) drawXAxisLabelsWithContext:(CGContextRef) context{
不過,我想有在水平軸上的不是數字日期...
任何想法?
TKGraphViewPoint協議似乎有一個xLabel屬性 - 如果你設置了這個屬性會發生什麼? – deanWombourne 2010-10-07 13:00:48