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
 
11
        <script>
12
            var chart;
13
 
14
            var chartData = [
15
                {
16
                    "country": "USA",
17
                    "visits": 4025,
18
                    "color": "#FF0F00"
19
                },
20
                {
21
                    "country": "China",
22
                    "visits": 1882,
23
                    "color": "#FF6600"
24
                },
25
                {
26
                    "country": "Japan",
27
                    "visits": 1809,
28
                    "color": "#FF9E01"
29
                },
30
                {
31
                    "country": "Germany",
32
                    "visits": 1322,
33
                    "color": "#FCD202"
34
                },
35
                {
36
                    "country": "UK",
37
                    "visits": 1122,
38
                    "color": "#F8FF01"
39
                },
40
                {
41
                    "country": "France",
42
                    "visits": 1114,
43
                    "color": "#B0DE09"
44
                },
45
                {
46
                    "country": "India",
47
                    "visits": 984,
48
                    "color": "#04D215"
49
                },
50
                {
51
                    "country": "Spain",
52
                    "visits": 711,
53
                    "color": "#0D8ECF"
54
                },
55
                {
56
                    "country": "Netherlands",
57
                    "visits": 665,
58
                    "color": "#0D52D1"
59
                },
60
                {
61
                    "country": "Russia",
62
                    "visits": 580,
63
                    "color": "#2A0CD0"
64
                },
65
                {
66
                    "country": "South Korea",
67
                    "visits": 443,
68
                    "color": "#8A0CCF"
69
                },
70
                {
71
                    "country": "Canada",
72
                    "visits": 441,
73
                    "color": "#CD0D74"
74
                },
75
                {
76
                    "country": "Brazil",
77
                    "visits": 395,
78
                    "color": "#754DEB"
79
                },
80
                {
81
                    "country": "Italy",
82
                    "visits": 386,
83
                    "color": "#DDDDDD"
84
                },
85
                {
86
                    "country": "Australia",
87
                    "visits": 384,
88
                    "color": "#999999"
89
                },
90
                {
91
                    "country": "Taiwan",
92
                    "visits": 338,
93
                    "color": "#333333"
94
                },
95
                {
96
                    "country": "Poland",
97
                    "visits": 328,
98
                    "color": "#000000"
99
                }
100
            ];
101
 
102
 
103
            AmCharts.ready(function () {
104
                // SERIAL CHART
105
                chart = new AmCharts.AmSerialChart();
106
                chart.dataProvider = chartData;
107
                chart.categoryField = "country";
108
                // the following two lines makes chart 3D
109
                chart.depth3D = 20;
110
                chart.angle = 30;
111
 
112
                // AXES
113
                // category
114
                var categoryAxis = chart.categoryAxis;
115
                categoryAxis.labelRotation = 90;
116
                categoryAxis.dashLength = 5;
117
                categoryAxis.gridPosition = "start";
118
 
119
                // value
120
                var valueAxis = new AmCharts.ValueAxis();
121
                valueAxis.title = "Visitors";
122
                valueAxis.dashLength = 5;
123
                chart.addValueAxis(valueAxis);
124
 
125
                // GRAPH
126
                var graph = new AmCharts.AmGraph();
127
                graph.valueField = "visits";
128
                graph.colorField = "color";
129
                graph.balloonText = "<span style='font-size:14px'>[[category]]: <b>[[value]]</b></span>";
130
                graph.type = "column";
131
                graph.lineAlpha = 0;
132
                graph.fillAlphas = 1;
133
                chart.addGraph(graph);
134
 
135
                // CURSOR
136
                var chartCursor = new AmCharts.ChartCursor();
137
                chartCursor.cursorAlpha = 0;
138
                chartCursor.zoomable = false;
139
                chartCursor.categoryBalloonEnabled = false;
140
                chart.addChartCursor(chartCursor);
141
 
142
                chart.creditsPosition = "top-right";
143
 
144
 
145
                // WRITE
146
                chart.write("chartdiv");
147
            });
148
        </script>
149
    </head>
150
 
151
    <body>
152
        <div id="chartdiv" style="width: 100%; height: 400px;"></div>
153
    </body>
154
 
155
</html>