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
        <script src="../amcharts/amcharts.js" type="text/javascript"></script>
8
        <script src="../amcharts/serial.js" type="text/javascript"></script>
9
 
10
        <script>
11
            var chart;
12
 
13
            var chartData = [
14
                {
15
                    "country": "Czech Republic",
16
                    "litres": 156.9,
17
                    "short": "CZ"
18
                },
19
                {
20
                    "country": "Ireland",
21
                    "litres": 131.1,
22
                    "short": "IR"
23
                },
24
                {
25
                    "country": "Germany",
26
                    "litres": 115.8,
27
                    "short": "DE"
28
                },
29
                {
30
                    "country": "Australia",
31
                    "litres": 109.9,
32
                    "short": "AU"
33
                },
34
                {
35
                    "country": "Austria",
36
                    "litres": 108.3,
37
                    "short": "AT"
38
                },
39
                {
40
                    "country": "UK",
41
                    "litres": 99,
42
                    "short": "UK"
43
                },
44
                {
45
                    "country": "Belgium",
46
                    "litres": 93,
47
                    "short": "BE"
48
                }
49
            ];
50
 
51
            AmCharts.ready(function () {
52
                // SERIAL CHART
53
                var chart = new AmCharts.AmSerialChart();
54
                chart.dataProvider = chartData;
55
                chart.categoryField = "country";
56
                chart.startDuration = 2;
57
                // change balloon text color
58
                chart.balloon.color = "#000000";
59
 
60
                // AXES
61
                // category
62
                var categoryAxis = chart.categoryAxis;
63
                categoryAxis.gridAlpha = 0;
64
                categoryAxis.axisAlpha = 0;
65
                categoryAxis.labelsEnabled = false;
66
 
67
                // value
68
                var valueAxis = new AmCharts.ValueAxis();
69
                valueAxis.gridAlpha = 0;
70
                valueAxis.axisAlpha = 0;
71
                valueAxis.labelsEnabled = false;
72
                valueAxis.minimum = 0;
73
                chart.addValueAxis(valueAxis);
74
 
75
                // GRAPH
76
                var graph = new AmCharts.AmGraph();
77
                graph.balloonText = "[[category]]: [[value]]";
78
                graph.valueField = "litres";
79
                graph.descriptionField = "short";
80
                graph.type = "column";
81
                graph.lineAlpha = 0;
82
                graph.fillAlphas = 1;
83
                graph.fillColors = ["#ffe78e", "#bf1c25"];
84
                graph.labelText = "[[description]]";
85
                graph.balloonText = "[[category]]: [[value]] Litres";
86
                chart.addGraph(graph);
87
 
88
                chart.creditsPosition = "top-right";
89
 
90
                // WRITE
91
                chart.write("chartdiv");
92
            });
93
        </script>
94
    </head>
95
 
96
    <body>
97
        <div id="chartdiv" style="width: 520px; height: 400px;"></div>
98
    </body>
99
 
100
</html>