Subversion Repositories php-qbpwcf

Rev

Rev 23 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
23 liveuser 1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
<html>
3
 
4
    <head>
5
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6
        <title>amCharts examples</title>
7
        <link rel="stylesheet" href="style.css" type="text/css">
8
        <script src="../amcharts/amcharts.js" type="text/javascript"></script>
9
		<script src="../amcharts/serial.js" type="text/javascript"></script>
10
		<script src="../amcharts/pie.js" type="text/javascript"></script>
11
 
12
        <script>
13
 
14
			AmCharts.ready(function () {
15
 
16
			    // line chart, with a bullet at the end
17
			    var chart = new AmCharts.AmSerialChart();
18
			    chart.dataProvider = [{
19
			        "day": 1,
20
			            "value": 120
21
			    }, {
22
			        "day": 2,
23
			            "value": 124
24
			    }, {
25
			        "day": 3,
26
			            "value": 127
27
			    }, {
28
			        "day": 4,
29
			            "value": 122
30
			    }, {
31
			        "day": 5,
32
			            "value": 121
33
			    }, {
34
			        "day": 6,
35
			            "value": 123
36
			    }, {
37
			        "day": 7,
38
			            "value": 118
39
			    }, {
40
			        "day": 8,
41
			            "value": 113
42
			    }, {
43
			        "day": 9,
44
			            "value": 122
45
			    }, {
46
			        "day": 10,
47
			            "value": 125,
48
			        bullet: "round"
49
			    }];
50
			    chart.categoryField = "day";
51
			    chart.autoMargins = false;
52
			    chart.marginLeft = 0;
53
			    chart.marginRight = 5;
54
			    chart.marginTop = 0;
55
			    chart.marginBottom = 0;
56
 
57
			    var graph = new AmCharts.AmGraph();
58
			    graph.valueField = "value";
59
			    graph.bulletField = "bullet";
60
			    graph.showBalloon = false;
61
			    graph.lineColor = "#a9ec49";
62
			    chart.addGraph(graph);
63
 
64
			    var valueAxis = new AmCharts.ValueAxis();
65
			    valueAxis.gridAlpha = 0;
66
			    valueAxis.axisAlpha = 0;
67
			    chart.addValueAxis(valueAxis);
68
 
69
			    var categoryAxis = chart.categoryAxis;
70
			    categoryAxis.gridAlpha = 0;
71
			    categoryAxis.axisAlpha = 0;
72
			    categoryAxis.startOnAxis = true;
73
			    chart.write("line1");
74
 
75
 
76
			    // small column chart
77
			    chart = new AmCharts.AmSerialChart();
78
			    chart.dataProvider = [{
79
			        "day": 1,
80
			            "value": -5
81
			    }, {
82
			        "day": 2,
83
			            "value": 3
84
			    }, {
85
			        "day": 3,
86
			            "value": 7
87
			    }, {
88
			        "day": 4,
89
			            "value": -3
90
			    }, {
91
			        "day": 5,
92
			            "value": 3
93
			    }, {
94
			        "day": 6,
95
			            "value": 4
96
			    }, {
97
			        "day": 7,
98
			            "value": 6
99
			    }, {
100
			        "day": 8,
101
			            "value": -3
102
			    }, {
103
			        "day": 9,
104
			            "value": -2
105
			    }, {
106
			        "day": 10,
107
			            "value": 6
108
			    }];
109
			    chart.categoryField = "day";
110
			    chart.autoMargins = false;
111
			    chart.marginLeft = 0;
112
			    chart.marginRight = 0;
113
			    chart.marginTop = 0;
114
			    chart.marginBottom = 0;
115
 
116
			    graph = new AmCharts.AmGraph();
117
			    graph.valueField = "value";
118
			    graph.type = "column";
119
			    graph.fillAlphas = 1;
120
			    graph.lineColor = "#a9ec49";
121
			    graph.showBalloon = false;
122
			    chart.addGraph(graph);
123
 
124
			    valueAxis = new AmCharts.ValueAxis();
125
			    valueAxis.gridAlpha = 0;
126
			    valueAxis.axisAlpha = 0;
127
			    chart.addValueAxis(valueAxis);
128
 
129
			    categoryAxis = chart.categoryAxis;
130
			    categoryAxis.gridAlpha = 0;
131
			    categoryAxis.axisAlpha = 0;
132
			    chart.write("column1");
133
 
134
 
135
			    // line chart, with different line color below zero
136
			    chart = new AmCharts.AmSerialChart();
137
			    chart.dataProvider = [{
138
			        "day": 1,
139
			            "value": 120
140
			    }, {
141
			        "day": 2,
142
			            "value": 54
143
			    }, {
144
			        "day": 3,
145
			            "value": -18
146
			    }, {
147
			        "day": 4,
148
			            "value": -12
149
			    }, {
150
			        "day": 5,
151
			            "value": -51
152
			    }, {
153
			        "day": 6,
154
			            "value": 12
155
			    }, {
156
			        "day": 7,
157
			            "value": 56
158
			    }, {
159
			        "day": 8,
160
			            "value": 113
161
			    }, {
162
			        "day": 9,
163
			            "value": 142
164
			    }, {
165
			        "day": 10,
166
			            "value": 125
167
			    }];
168
			    chart.categoryField = "day";
169
			    chart.autoMargins = false;
170
			    chart.marginLeft = 0;
171
			    chart.marginRight = 5;
172
			    chart.marginTop = 0;
173
			    chart.marginBottom = 0;
174
 
175
			    graph = new AmCharts.AmGraph();
176
			    graph.valueField = "value";
177
			    graph.showBalloon = false;
178
			    graph.lineColor = "#ffbf63";
179
			    graph.negativeLineColor = "#289eaf";
180
			    chart.addGraph(graph);
181
 
182
			    valueAxis = new AmCharts.ValueAxis();
183
			    valueAxis.gridAlpha = 0;
184
			    valueAxis.axisAlpha = 0;
185
			    chart.addValueAxis(valueAxis);
186
 
187
			    categoryAxis = chart.categoryAxis;
188
			    categoryAxis.gridAlpha = 0;
189
			    categoryAxis.axisAlpha = 0;
190
			    categoryAxis.startOnAxis = true;
191
 
192
			    // using guide to show 0 grid
193
			    var guide = new AmCharts.Guide();
194
			    guide.value = 0;
195
			    guide.lineAlpha = 0.1;
196
			    valueAxis.addGuide(guide);
197
			    chart.write("line2");
198
 
199
 
200
			    // column chart with different negative colors
201
			    chart = new AmCharts.AmSerialChart();
202
			    chart.dataProvider = [{
203
			        "day": 1,
204
			            "value": -5
205
			    }, {
206
			        "day": 2,
207
			            "value": 3
208
			    }, {
209
			        "day": 3,
210
			            "value": 7
211
			    }, {
212
			        "day": 4,
213
			            "value": -3
214
			    }, {
215
			        "day": 5,
216
			            "value": 3
217
			    }, {
218
			        "day": 6,
219
			            "value": 4
220
			    }, {
221
			        "day": 7,
222
			            "value": 6
223
			    }, {
224
			        "day": 8,
225
			            "value": -3
226
			    }, {
227
			        "day": 9,
228
			            "value": -2
229
			    }, {
230
			        "day": 10,
231
			            "value": 6
232
			    }];
233
			    chart.categoryField = "day";
234
			    chart.autoMargins = false;
235
			    chart.marginLeft = 0;
236
			    chart.marginRight = 0;
237
			    chart.marginTop = 0;
238
			    chart.marginBottom = 0;
239
 
240
			    graph = new AmCharts.AmGraph();
241
			    graph.valueField = "value";
242
			    graph.type = "column";
243
			    graph.fillAlphas = 1;
244
			    graph.showBalloon = false;
245
			    graph.lineColor = "#ffbf63";
246
			    graph.negativeFillColors = "#289eaf";
247
			    graph.negativeLineColor = "#289eaf";
248
			    chart.addGraph(graph);
249
 
250
			    valueAxis = new AmCharts.ValueAxis();
251
			    valueAxis.gridAlpha = 0;
252
			    valueAxis.axisAlpha = 0;
253
			    chart.addValueAxis(valueAxis);
254
 
255
			    categoryAxis = chart.categoryAxis;
256
			    categoryAxis.gridAlpha = 0;
257
			    categoryAxis.axisAlpha = 0;
258
			    chart.write("column2");
259
 
260
 
261
			    // column chart (thermometer)
262
			    chart = new AmCharts.AmSerialChart();
263
			    chart.dataProvider = [{
264
			        x: 1,
265
			        y: 100
266
			    }];
267
			    chart.categoryField = "x";
268
			    chart.rotate = true;
269
			    chart.autoMargins = false;
270
			    chart.marginLeft = 0;
271
			    chart.marginRight = 0;
272
			    chart.marginTop = 0;
273
			    chart.marginBottom = 0;
274
 
275
			    graph = new AmCharts.AmGraph();
276
			    graph.valueField = "y";
277
			    graph.type = "column";
278
			    graph.fillAlphas = 1;
279
			    graph.fillColors = ["#49cbec", "#f73838"];
280
			    graph.gradientOrientation = "horizontal";
281
			    graph.lineColor = "#FFFFFF";
282
			    graph.showBalloon = false;
283
			    chart.addGraph(graph);
284
 
285
			    valueAxis = new AmCharts.ValueAxis();
286
			    valueAxis.gridAlpha = 0;
287
			    valueAxis.axisAlpha = 0;
288
			    valueAxis.stackType = "100%"; // this is set to achieve that column would occupie 100% of the chart area
289
			    chart.addValueAxis(valueAxis);
290
 
291
			    categoryAxis = chart.categoryAxis;
292
			    categoryAxis.gridAlpha = 0;
293
			    categoryAxis.axisAlpha = 0;
294
 
295
			    // guide to show position
296
			    guide = new AmCharts.Guide();
297
			    guide.value = 66;
298
			    guide.lineAlpha = 1;
299
			    guide.above = true;
300
			    valueAxis.addGuide(guide);
301
			    chart.write("thermometer1");
302
 
303
 
304
 
305
			    // column chart (thermometer)
306
			    chart = new AmCharts.AmSerialChart();
307
			    chart.dataProvider = [{
308
			        "x": 1,
309
			            "y": 100
310
			    }];
311
			    chart.categoryField = "x";
312
			    chart.rotate = true;
313
			    chart.autoMargins = false;
314
			    chart.marginLeft = 0;
315
			    chart.marginRight = 0;
316
			    chart.marginTop = 0;
317
			    chart.marginBottom = 0;
318
 
319
			    graph = new AmCharts.AmGraph();
320
			    graph.valueField = "y";
321
			    graph.type = "column";
322
			    graph.fillAlphas = 1;
323
			    graph.fillColors = ["#49cbec", "#f73838"];
324
			    graph.gradientOrientation = "horizontal";
325
			    graph.lineColor = "#FFFFFF";
326
			    graph.showBalloon = false;
327
			    chart.addGraph(graph);
328
 
329
			    valueAxis = new AmCharts.ValueAxis();
330
			    valueAxis.gridAlpha = 0;
331
			    valueAxis.axisAlpha = 0;
332
			    valueAxis.stackType = "100%"; // this is set to achieve that column would occupie 100% of the chart area
333
			    chart.addValueAxis(valueAxis);
334
 
335
			    categoryAxis = chart.categoryAxis;
336
			    categoryAxis.gridAlpha = 0;
337
			    categoryAxis.axisAlpha = 0;
338
 
339
			    // guide to show position
340
			    guide = new AmCharts.Guide();
341
			    guide.value = 29;
342
			    guide.lineAlpha = 1;
343
			    guide.above = true;
344
			    valueAxis.addGuide(guide);
345
			    chart.write("thermometer2");
346
 
347
 
348
 
349
 
350
			    // percent chart
351
			    chart = new AmCharts.AmSerialChart();
352
			    chart.dataProvider = [{
353
			        "x": 1,
354
			            "y1": 66,
355
			            "y2": 34
356
			    }];
357
			    chart.categoryField = "x";
358
			    chart.rotate = true;
359
			    chart.autoMargins = false;
360
			    chart.marginLeft = 0;
361
			    chart.marginRight = 0;
362
			    chart.marginTop = 0;
363
			    chart.marginBottom = 0;
364
 
365
			    graph = new AmCharts.AmGraph();
366
			    graph.valueField = "y1";
367
			    graph.type = "column";
368
			    graph.fillAlphas = 0.6;
369
			    graph.fillColors = "#000000";
370
			    graph.gradientOrientation = "horizontal";
371
			    graph.lineColor = "#FFFFFF";
372
			    graph.showBalloon = false;
373
			    chart.addGraph(graph);
374
 
375
			    var graph2 = new AmCharts.AmGraph();
376
			    graph2.valueField = "y2";
377
			    graph2.type = "column";
378
			    graph2.fillAlphas = 0.2;
379
			    graph2.fillColors = "#000000";
380
			    graph2.lineColor = "#FFFFFF";
381
			    graph2.showBalloon = false;
382
			    chart.addGraph(graph2);
383
 
384
			    valueAxis = new AmCharts.ValueAxis();
385
			    valueAxis.gridAlpha = 0;
386
			    valueAxis.axisAlpha = 0;
387
			    valueAxis.stackType = "100%"; // this is set to achieve that column would occupie 100% of the chart area
388
			    chart.addValueAxis(valueAxis);
389
 
390
			    categoryAxis = chart.categoryAxis;
391
			    categoryAxis.gridAlpha = 0;
392
			    categoryAxis.axisAlpha = 0;
393
 
394
			    chart.write("percent1");
395
 
396
 
397
			    // percent chart
398
			    chart = new AmCharts.AmSerialChart();
399
			    chart.dataProvider = [{
400
			        "x": 1,
401
			            "y1": 29,
402
			            "y2": 71
403
			    }];
404
			    chart.categoryField = "x";
405
			    chart.rotate = true;
406
			    chart.autoMargins = false;
407
			    chart.marginLeft = 0;
408
			    chart.marginRight = 0;
409
			    chart.marginTop = 0;
410
			    chart.marginBottom = 0;
411
 
412
			    graph = new AmCharts.AmGraph();
413
			    graph.valueField = "y1";
414
			    graph.type = "column";
415
			    graph.fillAlphas = 0.6;
416
			    graph.fillColors = "#000000";
417
			    graph.gradientOrientation = "horizontal";
418
			    graph.lineColor = "#FFFFFF";
419
			    graph.showBalloon = false;
420
			    chart.addGraph(graph);
421
 
422
			    graph2 = new AmCharts.AmGraph();
423
			    graph2.valueField = "y2";
424
			    graph2.type = "column";
425
			    graph2.fillAlphas = 0.2;
426
			    graph2.fillColors = "#000000";
427
			    graph2.lineColor = "#FFFFFF";
428
			    graph2.showBalloon = false;
429
			    chart.addGraph(graph2);
430
 
431
			    valueAxis = new AmCharts.ValueAxis();
432
			    valueAxis.gridAlpha = 0;
433
			    valueAxis.axisAlpha = 0;
434
			    valueAxis.stackType = "100%"; // this is set to achieve that column would occupie 100% of the chart area
435
			    chart.addValueAxis(valueAxis);
436
 
437
			    categoryAxis = chart.categoryAxis;
438
			    categoryAxis.gridAlpha = 0;
439
			    categoryAxis.axisAlpha = 0;
440
			    chart.write("percent2");
441
 
442
			    // small pie chart
443
			    chart = new AmCharts.AmPieChart();
444
			    chart.dataProvider = [{
445
			        "x": 1,
446
			            "value": 29
447
			    }, {
448
			        "x": 2,
449
			            "value": 71
450
			    }];
451
			    chart.labelField = "x";
452
			    chart.valueField = "value";
453
			    chart.labelsEnabled = false;
454
			    chart.balloonText = undefined;
455
			    chart.valueText = undefined;
456
			    chart.radius = 10; // half of a width of a div
457
			    chart.colors = ["#DADADA", "#777777"];
458
			    chart.startDuration = 0;
459
			    chart.write("pie1");
460
 
461
			    // small pie chart
462
			    chart = new AmCharts.AmPieChart();
463
			    chart.dataProvider = [{
464
			        "x": 1,
465
			            "value": 45
466
			    }, {
467
			        "x": 2,
468
			            "value": 55
469
			    }];
470
			    chart.labelField = "x";
471
			    chart.balloonText = undefined;
472
			    chart.valueField = "value";
473
			    chart.labelsEnabled = false;
474
			    chart.valueText = undefined;
475
			    chart.radius = 10;
476
			    chart.colors = ["#DADADA", "#777777"];
477
			    chart.startDuration = 0;
478
			    chart.write("pie2");
479
 
480
			});
481
 
482
        </script>
483
    </head>
484
 
485
    <body>
486
 
487
    <!-- first chart group -->
488
    <div class="chart-block">
489
      <p><b>Some simple sparklines and micro column chart:</b></p>
490
      Alaska, 120 <div id="line1" style="vertical-align: middle; display: inline-block; width: 100px; height: 30px;"></div> 6% <div id="column1" style="vertical-align: middle;display: inline-block; width: 110px; height: 30px;"></div>
491
    </div>
492
 
493
    <!-- second chart group -->
494
    <div class="chart-block">
495
      <p><b>More advanced, with different line and fill colors:</b></p>
496
      Alaska, 120 <div id="line2" style="vertical-align: middle; display: inline-block; width: 100px; height: 30px;"></div> 6% <div id="column2" style="vertical-align: middle;display: inline-block; width: 110px; height: 30px;"></div>
497
    </div>
498
 
499
    <!-- third chart group -->
500
    <div class="chart-block">
501
      <p><b>Thermometer example:</b></p>
502
      Alaska, 66% <div id="thermometer1" style="vertical-align: middle; display: inline-block; width: 100px; height: 20px;"></div><br />
503
      Alabama, 39% <div id="thermometer2" style="vertical-align: middle;display: inline-block; width: 100px; height: 20px"></div>
504
    </div>
505
 
506
    <!-- fourth chart group -->
507
    <div class="chart-block">
508
      <p><b>Simple percent chart example:</b></p>
509
      Alaska, 66% <div id="percent1" style="vertical-align: middle; display: inline-block; width: 100px; height: 20px;"></div><br />
510
      Alabama, 39% <div id="percent2" style="vertical-align: middle;display: inline-block; width: 100px; height: 20px;"></div>
511
    </div>
512
 
513
    <!-- fifth chart group -->
514
    <div class="chart-block">
515
      <p><b>Simple percent chart example:</b></p>
516
      Alaska, 71% <div id="pie1" style="vertical-align: middle; display: inline-block; width: 20px; height: 20px;"></div><br />
517
      Alabama, 45% <div id="pie2" style="vertical-align: middle; display: inline-block; width: 20px; height: 20px;"></div>
518
    </div>
519
 
520
    <p>Please note that sparkline charts are NOT usable with the free version of JavaScript Charts due to branding link taking up most of the plot area. Please consider <a href="http://shop.amcharts.com/">acquiring a commercial license</a>. (licenses starting as low as USD 140)</p>
521
 
522
</html>