Hi every body i am new in iPhone application development. In my application need Piechart so i am used google chart api i got that piechart image. but it displayed static only. how to give value in this url for creating dynamic piechart.
How to pass the value for chart, in this below url.
NSString* myurl=@"http://chart.apis.google.com/chart?chf=bg,s,67676700&chs=300x225&cht=p&chd=s:Uf9a&chdl=30°|40°|50°|60°";
NSString *theurl=[myurl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
Below is my corresponding code:
NSMutableURLRequest *theRequest=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:theurl] 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];
graphimage.image=myimage;
Hey you have to put your own input in the url itself but you need to know the parameters and what for it is used. check this API doc to know about that parameters
http://code.google.com/apis/chart/image/docs/making_charts.html
http://chart.apis.google.com/chart?chf=bg,s,67676700&chs=300×225&cht=p&chd=s:Uf9a&chdl=30°|40°|50°|60°
In this url change the chf chs value whichever you want.