This repository has been archived by the owner on Nov 25, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
examples.html
405 lines (371 loc) · 17.7 KB
/
examples.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
<!DOCTYPE html>
<html>
<head>
<title>Google Charts!</title>
<style type="text/css" media="screen">
th { font-size: 18px; text-align: left; border-top: 1px #ccc solid; padding-top: 4px; }
table { margin-left: auto; margin-right: auto; }
</style>
</head>
<body>
<h2>Chart tag examples</h2>
<table>
<tbody>
<tr>
<th colspan="2">3D pie chart, simple data, labels</th>
<tr>
<td><pre>{% chart %}
{% chart-data data1 %}
{% chart-size "300x200" %}
{% chart-type "pie" %}
{% chart-labels "One" "Two" "Three" %}
{% chart-alt "It worked!" %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?chs=300x200&cht=p&chl=One|Two|Three&chd=e:VVqq.." width="300" height="200" alt="It worked!" /></td>
</tr>
<tr>
<th colspan="2">Line chart, legend, fill, colors, saving as a variable</th>
<tr>
<td><pre>{% chart as c %}
{% chart-data data2 %}
{% chart-type "line" %}
{% chart-size "300x200" %}
{% chart-colors "CC0000" %}
{% chart-fill "EEEEEE" %}
{% chart-legend "Sweet" %}
{% endchart %}
<img src="{{ c.url }}" width="300" height="200" /></pre></td>
<td>
<img src="http://chart.apis.google.com/chart?cht=lc&chs=300x200&chco=CC0000&chf=c,s,EEEEEE&chdl=Sweet&chd=e:AAALAtBmC1EcGYIsLWOXRuVdZhd9ivn4tYzO5b.." width="300" height="200" /></td>
</tr>
<tr>
<th colspan="2">Titles, multiple colors, background</th>
<tr>
<td><pre>{% chart %}
{% chart-title "Hello, World!" %}
{% chart-data data2 data3 %}
{% chart-type "line" %}
{% chart-size "300x200" %}
{% chart-colors "CC0000" "00CC00" %}
{% chart-background "EEEEEE" %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?chtt=Hello,+World%21&cht=lc&chs=300x200&chco=CC0000,00CC00&chf=bg,s,EEEEEE&chd=e:AAAKApBcCkEAFxH2KPM9QATXXCbCfXj.o9uPz15w,..5wz1uPo9j.fXbCXCTXQAM9KPH2FxEACkBcApAK" width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">Venn charts, background gradients</th>
<tr>
<td><pre>{% chart %}
{% chart-data venn %}
{% chart-type "venn" %}
{% chart-size "300" "200" %}
{% chart-background-gradient "45" "000000" "0" "FFFFFF" "0.6" %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?cht=v&chs=300x200&chf=bg,lg,45,000000,0,FFFFFF,0.6&chd=e:..zMmZTNTNTNGa" width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">Pie charts, stripes</th>
<tr>
<td><pre>{% chart %}
{% chart-data data1 %}
{% chart-size "300x200" %}
{% chart-type "pie" %}
{% chart-background-stripes "45" "cccccc" "0.05" "FFFFFF" "0.05" %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?chs=300x200&cht=p&chf=bg,ls,45,cccccc,0.05,FFFFFF,0.05&chd=e:VVqq.." width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">Bar chart, chart-bar-width</th>
<tr>
<td><pre>{% chart %}
{% chart-data data1 %}
{% chart-size "300x200" %}
{% chart-type "bar" %}
{% chart-bar-width 60 0 6 %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?chs=300x200&cht=bhg&chbh=60,0,6&chd=e:VVqq.." width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">Extension, column charts (grouped & stacked), filters in data expressions</th>
<tr>
<td><pre>{% chart as columns %}
{% chart-size "300x200" %}
{% chart-type "column-grouped" %}
{% chart-data data2|slice:"6:10" %}
{% chart-data data3|slice:"6:10" %}
{% chart-colors "CC0000" "0000CC" %}
{% chart-bar-width 30 5 10 %}
{% endchart %}
{{ columns.img }}
{% chart extends columns %}
{% chart-type "column-stacked" %}
{% chart-bar-width 70 6 0 %}
{% endchart %}</pre></td>
<td>
<img src="http://chart.apis.google.com/chart?chs=300x200&cht=bvg&chco=CC0000,0000CC&chbh=30,5,10&chd=e:LwQAU5ac,..3LvBng" width="300" height="200" alt="" />
<img src="http://chart.apis.google.com/chart?chs=300x200&cht=bvs&chco=CC0000,0000CC&chbh=70,6,0&chd=e:LwQAU5ac,..3LvBng" width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">Data scaling to avoid truncation</th>
<tr>
<td><pre>{% chart %}
{% chart-size "300x200" %}
{% chart-type "column-stacked" %}
{% chart-data data2|slice:"6:10" %}
{% chart-data data3|slice:"6:10" %}
{% chart-data-scale "-10,250" %}
{% chart-colors "CC0000" "0000CC" %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?chs=300x200&cht=bvs&chds=-10,250&chco=CC0000,0000CC&chd=t:36.0,49.0,64.0,81.0|196.0,169.0,144.0,121.0" width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">Fake grid lines drawn on top of data</th>
<tr>
<td><pre>{% chart %}
{% chart-size "300x200" %}
{% chart-type "column" %}
{% chart-data "0.001,2,6,14,18,0.001" %}
{% chart-data-scale "0,20" %}
{% chart-colors "CC0000" %}
{% chart-grid-lines %}
{% chart-grid-lines-data grid_lines_data %}
{% chart-grid-lines-style grid_lines_style %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?chs=300x200&cht=bvg&chds=0,20&chco=CC0000&chm=D,FFFFFF,1,0,1,1|D,FFFFFF,2,0,1,1|D,FFFFFF,3,0,1,1&chd=t:0.001,2.0,6.0,14.0,18.0,0.001|5.0,5.0,5.0,5.0,5.0,5.0|10.0,10.0,10.0,10.0,10.0,10.0|15.0,15.0,15.0,15.0,15.0,15.0" width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">Scatter chart</th>
<tr>
<td><pre>{% chart %}
{% chart-data data2 %}
{% chart-data data3 %}
{% chart-size "300x200" %}
{% chart-type "scatter" %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?chs=300x200&cht=s&chd=e:AAAKApBcCkEAFxH2KPM9QATXXCbCfXj.o9uPz15w,..5wz1uPo9j.fXbCXCTXQAM9KPH2FxEACkBcApAK" width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">Chart-line-style, chart-grid</th>
<tr>
<td><pre>{% chart %}
{% chart-data data2 data3 %}
{% chart-type "line" %}
{% chart-size "300x200" %}
{% chart-colors "CC0000" "00CC00" %}
{% chart-line-style 3 6 3 %}
{% chart-line-style 1 1 2 %}
{% chart-grid 15 15 1 1 %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?cht=lc&chs=300x200&chco=CC0000,00CC00&chls=3,6,3|1,1,2&chg=15,15,1,1&chd=e:AAAKApBcCkEAFxH2KPM9QATXXCbCfXj.o9uPz15w,..5wz1uPo9j.fXbCXCTXQAM9KPH2FxEACkBcApAK" width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">Extension, ranger markers, fill-area</th>
<tr>
<td><pre>{% chart as line %}
{% chart-type "line" %}
{% chart-size "300x200" %}
{% chart-range-marker "v" "E5ECF9" ".75" ".25" %}
{% chart-fill-area "76A4FB" %}
{% endchart %}
{% chart extends line %}
{% chart-data data2 %}
{% endchart %}</pre></td>
<td>
<img src="http://chart.apis.google.com/chart?cht=lc&chs=300x200&chm=R,E5ECF9,0,.75,.25|B,76A4FB,0,0,0&chd=e:AAALAtBmC1EcGYIsLWOXRuVdZhd9ivn4tYzO5b.." width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">More markers</th>
<tr>
<td><pre>{% chart %}
{% chart-data data2 data3 %}
{% chart-type "line" %}
{% chart-size "300x200" %}
{% chart-colors "CC0000" "00CC00" %}
{% chart-marker "circle" "cccc0077" 1 4 90 %}
{% chart-marker "x" "0000CC" 0 9.3 20 %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?cht=lc&chs=300x200&chco=CC0000,00CC00&chm=o,cccc0077,1,4,90|x,0000CC,0,9.3,20&chd=e:AAAKApBcCkEAFxH2KPM9QATXXCbCfXj.o9uPz15w,..5wz1uPo9j.fXbCXCTXQAM9KPH2FxEACkBcApAK" width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">Sensible defaults</th>
<tr>
<td><pre>{% chart %}
{% chart-data data2 data3 %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?chs=200x200&cht=lc&chd=e:AAAKApBcCkEAFxH2KPM9QATXXCbCfXj.o9uPz15w,..5wz1uPo9j.fXbCXCTXQAM9KPH2FxEACkBcApAK" width="200" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">Axes</th>
<tr>
<td><pre>{% chart %}
{% chart-type "line" %}
{% chart-size "300x200" %}
{% chart-range-marker "v" "E5ECF9" ".75" ".25" %}
{% chart-fill-area "76A4FB" %}
{% chart-data data2|slice:"::-1" %}
{% axis "left" %}
{% axis-range 0 100 %}
{% endaxis %}
{% axis "bottom" %}
{% axis-labels "Jan" "Feb" "Mar" "Apr" %}
{% endaxis %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?cht=lc&chs=300x200&chm=R,E5ECF9,0,.75,.25|B,76A4FB,0,0,0&chd=e:..5bzOtYn4ivd9ZhVdRuOXLWIsGYEcC1BmAtALAA&chxt=y,x&chxr=0,0,100&chxl=1:|Jan|Feb|Mar|Apr" width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">More axes</th>
<tr>
<td><pre>{% chart %}
{% chart-size "300x200" %}
{% chart-type "column-grouped" %}
{% chart-data data2|slice:"6:10" %}
{% chart-data data3|slice:"6:10" %}
{% chart-colors "CC0000" "0000CC" %}
{% chart-bar-width 30 5 10 %}
{% chart-background-stripes 0 "cccccc" 0.25 "ffffff" 0.25 %}
{% axis "top" %}
{% axis-labels "Group 1" "Group 2" "Group 3" "Control" %}
{% axis-label-positions 10 37 62 87 %}
{% axis-style "000000" "14" %}
{% endaxis %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?chs=300x200&cht=bvg&chco=CC0000,0000CC&chbh=30,5,10&chf=bg,ls,0,cccccc,0.25,ffffff,0.25&chd=e:LwQAU5ac,..3LvBng&chxt=t&chxl=0:|Group+1|Group+2|Group+3|Control&chxp=0,10,37,62,87&chxs=0,000000,14" width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">Data provided as literals</th>
<tr>
<td><pre>{% chart %}
{% chart-size "300x200" %}
{% chart-type "pie-3d" %}
{% chart-data "60,30,10" %}
{% chart-colors "cc00ee" %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?chs=300x200&cht=p3&chco=cc00ee&chd=e:..gAKr" width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">Automatic scaling of negative data</th>
<tr>
<td><pre>{% chart %}
{% chart-size "300x200" %}
{% chart-type "line" %}
{% chart-data data4 %}
{% chart-range-marker "h" "000000" ".499" ".501" %}
{% axis "bottom" hide %}
{% axis "left" %}
{% axis-labels 5 0 -5 %}
{% endaxis %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?chs=300x200&cht=lc&chm=r,000000,0,.499,.501&chd=e:gAmXsdyE296791.i...K9G541nwgqukheIX1R2MbHyEHBjANAIBUDvHRLzRIXEdWjvp-v01B5Z8w--.9.q-G7W3gyutMnIgzabUROmJnFhCeAnAAArClFrJ0O1UiathFnatcy83s7f-N.t.8-68o5O00vkptjddEWyQ4LlHGDmBPAGAPBpEQH-MpSGYGeakzq.wv116C&chxt=x,y&chxs=0,000000,11,0,_&chxl=0:|||1:|5|0|-5" width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">All-negative data</th>
<tr>
<td><pre>{% chart %}
{% chart-size "300x200" %}
{% chart-type "line" %}
{% chart-data "-1,-5,-10" %}
{% axis "left" %}
{% axis-range "-10" "0" %}
{% endaxis %}
{% axis "bottom" hide %}
{% chart-range-marker "h" "000000" 1 .997 %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?chs=300x200&cht=lc&chm=r,000000,0,1,0.997&chd=e:5lf.AA&chxt=y,x&chxr=0,-10,0&chxs=1,000000,11,0,_&chxl=1:||" width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">Explicit chart data range</th>
<tr>
<td><pre>{% chart %}
{% chart-size "300x200" %}
{% chart-type "line" %}
{% chart-data data4 %}
{% chart-colors "00cc00" %}
{% chart-line-style 4 %}
{% chart-data-range -10 10 %}
{% chart-range-marker "h" "000000" ".499" ".501" %}
{% axis "bottom" hide %}
{% axis "left" %}
{% axis-labels 10 0 -10 %}
{% endaxis %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?chs=300x200&cht=lc&chco=00cc00&chls=4&chm=r,000000,0,.499,.501&chd=e:gAjLmOpCretdu6vwv.vkuis7qzoPlWiQfEb6Y6WNT5SDQxQGQEQqR3ToV5Ykbheqh3k-n5qgssuYvev-v0vDtqrvpWmljkgZdNaIXTUzSwRPQTQAQVRSS1U6XaaRdWgijtmuper1tvvGv2v9vcuUsmqZnxk2huehbZYcVyTjRzQnQDQHQ0SIT.WUZDcDfNiZlfoXq6tA&chxt=x,y&chxs=0,000000,11,0,_&chxl=0:|||1:|10|0|-10" width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">Explicit "auto" chart data range</th>
<tr>
<td><pre>{% chart as sine %}
{% chart-size "300x200" %}
{% chart-type "line" %}
{% chart-data data4|slice:"::-1" %}
{% chart-data-range -10 10 %}
{% chart-colors "0000cc" %}
{% chart-line-style 2 2 2 %}
{% chart-range-marker "h" "000000" ".499" ".501" %}
{% axis "bottom" hide %}
{% endchart %}
{% chart extends sine %}
{% chart-data-range "auto" %}
{% endchart %}</pre></td>
<td>
<img src="http://chart.apis.google.com/chart?chs=300x200&cht=lc&chco=0000cc&chls=2,2,2&chm=r,000000,0,.499,.501&chd=e:6C11wvq.kzeaYGSGMpH-EQBpAPAGBPDmHGLlQ4WydEjdptvk005O8o-6.8.t-N7f3sy8tcnahFatUiO1J0FrClArAAAnCeFhJnOmURabgznItMyu3g7W-G.q.9--8w5Z1Bv0p-jvdWXERILzHRDvBUAIANBjEHHyMbR2X1eIkhquwg1n549G.K...i916729yEsdmXgA&chxt=x&chxs=0,000000,11,0,_&chxl=0:||" width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">Chart labels may also accept lists</th>
<tr>
<td><pre>{% chart %}
{% chart-data data1 %}
{% chart-size "300x200" %}
{% chart-type "pie" %}
{% chart-labels data1 %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?chs=300x200&cht=p&chl=10|20|30&chd=e:VVqq.." width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">Custom title sizes, colors</th>
<tr>
<td><pre>{% chart %}
{% chart-data data1 %}
{% chart-size "300x200" %}
{% chart-type "pie" %}
{% chart-title "Pie!" 18 "cc0000" %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?chs=300x200&cht=p&chts=cc0000,18&chtt=Pie%21&chd=e:VVqq.." width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">Custom pie orientation</th>
<tr>
<td><pre>{% chart %}
{% chart-data data1 %}
{% chart-size "300x200" %}
{% chart-type "pie" %}
{% chart-pie-orientation "4.7" %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?chs=300x200&cht=p&chp=4.7&chd=e:VVqq.." width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">Google-o-meter chart, with data scaling</th>
<tr>
<td><pre>{% chart %}
{% chart-labels "head" %}
{% chart-size "300x200" %}
{% chart-type "google-o-meter" %}
{% chart-data-scale "0,10" %}
{% chart-data "5" %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?chl=head&chs=300x200&cht=gom&chds=0,10&chd=t:5.0" width="300" height="200" alt="" /></td>
</tr>
<tr>
<th colspan="2">Map chart</th>
<tr>
<td><pre>{% chart %}
{% chart-size "440x220" %}
{% chart-type "map" %}
{% chart-map-area "usa" %}
{% chart-map-data mapdata %}
{% chart-colors "ffffff" "ff0000" "0000ff" %}
{% endchart %}</pre></td>
<td><img src="http://chart.apis.google.com/chart?chs=440x220&cht=t&chtm=usa&chld=KSCAMN&chco=ffffff,ff0000,0000ff&chd=e:AA..gA" width="440" height="220" alt="" /></td>
</tr>
</tbody>
</table>
</body>
</html>