こんにちは、私はすべてiPhoneのアプリケーション開発で新しいです。私のアプリケーションではPiechartが必要なので、私はGoogle chart apiを使っています。私はそのpiechartイメージを持っています。静的にしか表示されませんでした。動的なpiechartを作成するためのこのURLの価値を与える方法。google apiを使用してチャートのURLに自分の値を渡す方法はありますか?
グラフの値を渡す方法を以下のURLに示します。以下は
NSString* [email protected]"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];
私の対応するコードです:
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;
アイデアをお寄せいただきありがとうございます。 – sara