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?

Answers


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];

Need Your Help

Can you set Tomcat’s access log directory dynamically?

tomcat tomcat7 tomcat-valve

I am trying to know if it’s possible to have a per-month access log directory in Tomcat 7. After having read the access log Valve documentation it doesn’t seem like it.

How to override a Spring bean based on web server

spring deployment tomcat websphere

I'm building a webapp that should run on both Tomcat and WebSphere and I've managed to make almost all the differences into properties with default values that I can override for deployment on the ...