How do I draw or get an image of a ring (donut) chart for use in an iPhone Application?
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?
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.
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.
So I find out answer for question-> this is need to do,
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];