如何传递我自己的值在图表使用google api的url? [英] How to pass my own value in the url for chart using google api?

查看:86
本文介绍了如何传递我自己的值在图表使用google api的url?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi每个身体,我是新的iPhone应用程序开发。在我的应用程序需要Piechart所以我使用google图表API我得到了饼图图像。但它只显示静态。如何在此网址中创建动态饼图的价值。

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

下面是我的相应代码:

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;


推荐答案

嘿,你必须把自己的输入本身,但你需要知道参数和它为什么使用。请检查此API文档以了解该参数
http:// code.google.com/apis/chart/image/docs/making_charts.html

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 = 300x225& cht = p& chd = s:Uf9a& chdl = 30 °| 40°| 50°| 60°

http://chart.apis.google.com/chart?chf=bg,s,67676700&chs=300x225&cht=p&chd=s:Uf9a&chdl=30°|40°|50°|60°

在此网址中,您可以更改chf chs值。

In this url change the chf chs value whichever you want.

这篇关于如何传递我自己的值在图表使用google api的url?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆