views:

122

answers:

3

I want to be able to show some account information in a ring chart. I am able to show this in a pie chart format via Google chart APIs in my iPhone application, but my requirement is to show the information in a ring chart (also known as a donut chart).

Does anyone know how to do this?

A: 

I'm not aware of a component library that does exactly this, but if you don't need anything too fancy (i.e., 3D effects), you could always use Core Graphics to do the drawing. If you're familiar with OpenGL|ES, that's another option.

warrenm
I've created a sample project that illustrates how to draw a rudimentary pie chart using CoreGraphics. You should be able to adopt it to draw donut charts or other simple figures. Get it here: http://warrenmoore.net/files/piechart.zip
warrenm
thank you ,very much mr. warrenm ,i am very happy with your response and repository, i will back to you once i get through your pie chart application
mayur birari
A: 

The CorePlot library is now available for Cocoa Touch. It seems to have native support for numerous chart types, including pie charts.

Note that I made this a separate answer because I feel like it's more relevant than my sample project if it suits your needs. On the other hand, my code is more open to quick modification if CorePlot doesn't support your scenario.

warrenm
A: 

So I find out answer for my question-> this is what i want, i am very happy that i am answering to my own question

NSString* myurl=@"http://chart.apis.google.com/chart?cht=pc&chd=t:120,45%7c120,60,50,70,60&chs=300x200&chl=%7c%7chelo%7cwrd%7cindia%7cpak%7cban&chco=FFFFFF%7cFFFFFF,e72a28%7ca9d331%7cffce08%7c8a2585%7c184a7d";

NSMutableURLRequest *theRequest=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:myurl] cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                    timeoutInterval:60.0];                                              

NSURLResponse* response;
NSError* error;
NSData *imageData=[NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];
NSLog(@"%@",error); 
NSLog(@"%@",response);
NSLog(@"%@",imageData); 

UIImage *myimage = [[UIImage alloc] initWithData:imageData];
Mayur Birari