Make charts online using the Google Chart API Make-Charts online mit Hilfe der Google Chart API

Posted on December 1, 2008 at 5:34 am Geschrieben am 1. Dezember 2008 bei 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. Die Google Chart API ist eine Web-Service, dass Sie eine Verbindung herstellen können, um schnell generieren Diagramme für Ihre Blogs oder Websites. Da es sich um eine Web-Service, Sie werden nichts installiert werden in Ihrem Web-Server. Alles, was Sie brauchen, ist ein grundlegendes Verständnis darüber, wie es funktioniert.

Here is an actual example of a Hier ist tatsächlich ein Beispiel für eine chart created using Google Chart API Chart erstellt mit Google Chart API :

Bild

You can see that the chart was generated using a simple URL parameter manipulation: Sie können sehen, dass das Diagramm erzeugt wurde mit Hilfe eines einfachen URL-Parameter Manipulation:

Bild

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: Es gibt mindestens 3 Parameter (CHT, KHK und CHL), um zu können, erzeugen ein Diagramm. Nachfolgend sind die Schritte, um die Parameter:

Step 1: Define the Chart Type: cht Schritt 1: Definieren Sie die Chart-Typ: CHT

First you will need to define what type of chart you want.  A listing of all available chart types are located here: Erstens müssen Sie definieren, welche Art von Grafik Sie wollen. Eine Auflistung aller verfügbaren Diagrammtypen befinden sich hier: 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. In dem Beispiel, dass wir schaffen, werden wir CHT = P3, die ist ein Kreisdiagramm. Um andere Arten von Diagrammen, wie Bar-oder Line-Charts, nur Durchsuchen Sie die Arten von Charts und in den entsprechenden cht Parameterwert.

Step 2: Define the parameter for data and labels: chd and chl Schritt 2: Definieren Sie die Parameter für die Daten-und Etiketten: CHD und CHL

For example, we want to chart the distribution of each of the four brands below: Zum Beispiel, wir wollen Diagramm der Verteilung von jeder der vier Marken unter:

  1. BrandX=40 BrandX = 40
  2. BrandY=30 Brandy = 30
  3. BrandZ=20 BrandZ = 20
  4. BrandA=10 Branda = 10

The data (chd) parameter will be: chd=t:40,30,20,10 Die Daten (CHD) Parameter werden: CHD = t: 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: Hinweis: In dem Beispiel Ich habe mich für die Verwendung Text Encoding. So verwenden Sie andere Arten der Codierung klicken Sie auf den unten stehenden Link: http://code.google.com/apis/chart/formats.html

The label parameter (chl) is chl=BrandX,BrandY,BrandZ,BrandA Das Label-Parameter (CHL) ist CHL = BrandX, Brandy, BrandZ, Branda

The label parameter values are comma delimited and should have the same number of values as the data parameter. Das Label-Parameter-Werte werden durch Kommata getrennt und sollte die gleiche Anzahl von Werten, wie die Daten-Parameter.

Step 3: Define the size of the chart in pixel Schritt 3: Legen Sie die Größe der Grafik in Pixel

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 Das Format ist ein einfaches chs=<width in pixels>x<height in pixels> so dass, wenn wir wollen, dass ein 250X100-Chart, haben wir es wie folgt aus: CHS = 250X100

Step 4: Put the parameters together Schritt 4: Legen Sie die Parameter zusammen

Append the parameters to the main URL: Füge die Parameter für die Haupt-URL: http://chart.apis.google.com/chart?

+ parameter from step 1 + “&” + parameter from step 2 + “&” parameter from step 3 + Parameter aus Schritt 1 + "&" + Parameter aus Schritt 2 + "&"-Parameter aus Schritt 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: Beachten Sie, dass die Reihenfolge der Parameter in Web-Services ist nicht wichtig, solange Sie trennen Sie diese durch das kaufmännische Und-Zeichen "&". Siehe unten stehendes Beispiel:

http://chart.apis.google.com/chart?cht=p3&chd=t:40,30,20,10&chs=250×100&chl=BrandX|BrandY|BrandZ|BrandA http://chart.apis.google.com/chart?cht=p3&chd=t:40, 30,20,10 & chs = 250 × 100 & CHL = BrandX | Brandy | BrandZ | Branda

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. Es ist klar, dass Benutzer können leicht erstellen dynamische Diagramme mit Google Chart API. Dies ist ideal für Anwender, die nicht kaufen wollen komplexe Diagramm-Lösungen für ihre Web-Projekten.

Ben Carigtan shows you how it’s done. Ben Carigtan zeigt Ihnen, wie's geht.

Enjoyed this post? Genossen diesem Post? Subscribe to Online Tech Tips via Abonnieren Sie den Online-Tech Tipps über RSS Feed RSS-Feed or via oder über Email E-Mail and receive free daily productivity tips. und Sie erhalten täglich kostenlos Produktivität Tipps.

» Filed Under »Gespeichert unter Google Software/Tips Google-Software / Tipps

Add to Delicious Save this page Speichern Sie diese Seite Mixx es Stir it up on Mixx Rühren Sie es auf Mixx
Reddit Add to Reddit Add to Reddit StumbleUpon Stumble this page Stumble dieser Seite

Related Posts Verwandte Beiträge

Please post your comments/suggestions! Bitte posten Sie Ihre Kommentare und Vorschläge!