Make charts online using the Google Chart API制作图表在线使用API的谷歌图
Posted on December 1, 2008 at 5:34 am发布12月1日,在2008年上午5时34分
The Google Chart API is a web service that you can connect to quickly generate charts for your blogs or websites. Since it is a web service, you will not have to install anything in your web server. All you need is a basic understanding on how it works.在谷歌图的API是一个网上服务,您可以连接到快速生成的图表您的博客或网站。既然是网络服务,您将无法安装任何东西在您的Web服务器。所有你需要的是一个基本的了解如何它的作品。
Here is an actual example of a下面是一个实际例子 chart created using Google Chart API创建图表使用API的谷歌图 : :
You can see that the chart was generated using a simple URL parameter manipulation:您可以看到图表是使用生成一个简单的URL参数操纵:
There are at least 3 parameters ( cht, chd and chl ) to set to be able to generate a chart. Below are the steps to make those parameters:目前至少有3个参数( 中华电信,冠心病和叶绿素 )设置能够生成一个图表。下面是步骤,以使这些参数:
Step 1: Define the Chart Type: cht 第1步:定义图表类型:中华电信
First you will need to define what type of chart you want. A listing of all available chart types are located here:首先你需要确定什么类型的图表你想要的。列出所有可用的图表类型是这里找到: http://code.google.com/apis/chart/types.html
In the example that we will create, we will use cht=p3 which is a pie chart. To make other types of charts like bar or line charts, just browse the types of charts and put in the corresponding cht parameter value.在例如,我们将建立,我们将使用红隧= p3这是一个饼图。为了使其他类型的图表像酒吧或线图表上,刚刚浏览的各类图表,并在相应的中华电信参数值。
Step 2: Define the parameter for data and labels: chd and chl 第2步:定义参数数据和标签:冠心病和叶绿素
For example, we want to chart the distribution of each of the four brands below:举例来说,我们希望为分布的四个品牌如下:
- BrandX=40 BrandX = 40
- BrandY=30白兰地= 30
- BrandZ=20 BrandZ = 20
- BrandA=10 BrandA = 10
The data (chd) parameter will be: chd=t:40,30,20,10该数据( CHD )的参数是: 冠心病=吨: 40,30,20,10
Note: In the example I chose to use Text Encoding. To use other types of encoding click on the link below:注:例如,我选择使用文字编码。若要使用其他类型的编码点击下面的链接: http://code.google.com/apis/chart/formats.html
The label parameter (chl) is chl=BrandX,BrandY,BrandZ,BrandA标签参数(叶绿素)是叶绿素= BrandX ,白兰地, BrandZ , BrandA
The label parameter values are comma delimited and should have the same number of values as the data parameter.标签的参数值是逗号分隔,并应具有相同数目的价值观作为数据参数。
Step 3: Define the size of the chart in pixel 第3步:定义大小的图表像素
The format is a simple chs=<width in pixels>x<height in pixels> , so if we want to have a 250X100 chart, we put it like this: chs=250X100格式是一个简单的chs=<width in pixels>x<height in pixels> ,所以如果我们希望有一个250X100图表,我们把这样的: 社区卫生服务= 250X100
Step 4: Put the parameters together 第4步:把参数一起
Append the parameters to the main URL:附加的参数主要网址: http://chart.apis.google.com/chart? http://chart.apis.google.com/chart ?
+ parameter from step 1 + “&” + parameter from step 2 + “&” parameter from step 3 +参数步骤1 + “ & ” +参数步骤2 + “及”参数从第3步
Note that the order of parameters in web services is not important as long as you separate them with the ampersand character “&”. See example below:请注意,命令中的参数网络服务并不重要,只要你将它们分开的字元“ & ” 。见以下例子:
It is clear that users can easily create dynamic charts using Google Chart API. This is ideal for users who don’t want to buy complex charting solutions for their web projects.很显然,用户可以轻松地创建动态图表使用谷歌图的API 。这是用户的理想选择谁不想购买复杂的图表解决方案,其网络项目。
Ben Carigtan shows you how it’s done.本Carigtan告诉您如何它的工作要做。
» Filed Under »文章属于 Google Software/Tips谷歌软件/秘诀
Save this page 保存该网页 | Stir it up on Mixx 它搅动了Mixx | |
Add to Reddit 添加到Reddit |
Related Posts 有关职位
- How to make YouTube videos smaller如何使YouTube视频小
- Excel Tutorial - How to make a simple graph or chart in Excel Excel的教程-如何使一个简单的图形或图表在E xcel
- How to make a graph on excel如何使图表上精益求精
- GenerateData - Free online test data generator GenerateData -免费在线测试数据发生器
- Multiple find and replace of content using Grep多查找和替换的内容用Grep






















