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.rotate = true;
57
                chart.color = "#FFFFFF";
58
                chart.handDrawn = true;
59
                chart.handDrawScatter = 4;
60
 
61
                // this line makes the chart to show image in the background
62
                chart.backgroundImage = "images/bg.jpg";
63
 
64
                // sometimes we need to set margins manually
65
                // autoMargins should be set to false in order chart to use custom margin values
66
                chart.autoMargins = false;
67
                chart.marginTop = 100;
68
                chart.marginLeft = 50;
69
                chart.marginRight = 30;
70
                chart.startDuration = 2;
71
 
72
                // AXES
73
                // category
74
                var categoryAxis = chart.categoryAxis;
75
                categoryAxis.gridAlpha = 0;
76
                categoryAxis.axisAlpha = 0;
77
                categoryAxis.labelsEnabled = false;
78
 
79
                // value
80
                var valueAxis = new AmCharts.ValueAxis();
81
                valueAxis.gridAlpha = 0;
82
                valueAxis.axisAlpha = 0;
83
                valueAxis.labelsEnabled = false;
84
                valueAxis.minimum = 0;
85
                chart.addValueAxis(valueAxis);
86
 
87
                // GRAPH
88
                var graph = new AmCharts.AmGraph();
89
                graph.balloonText = "[[category]]: [[value]]";
90
                graph.valueField = "litres";
91
                graph.type = "column";
92
                graph.lineAlpha = 0;
93
                graph.fillAlphas = 0.5;
94
                // you can pass any number of colors in array to create more fancy gradients
95
                graph.fillColors = ["#000000", "#FF6600"];
96
                graph.gradientOrientation = "horizontal";
97
                graph.labelPosition = "inside";
98
                graph.labelText = "[[category]]: [[value]] Litres";
99
                graph.balloonText = "[[category]]: [[value]] Litres";
100
                chart.addGraph(graph);
101
 
102
                // LABEL
103
                chart.addLabel(50, 40, "Beer Consumption by country", "left", 15, "#000000", 0, 1, true);
104
 
105
                chart.creditsPosition = "bottom-right";
106
 
107
                // WRITE
108
                chart.write("chartdiv");
109
            });
110
        </script>
111
    </head>
112
 
113
    <body>
114
        <div id="chartdiv" style="width: 520px; height: 400px;"></div>
115
    </body>
116
 
117
</html>