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
                },
19
                {
20
                    "country": "China",
21
                    "visits": 1882
22
                },
23
                {
24
                    "country": "Japan",
25
                    "visits": 1809
26
                },
27
                {
28
                    "country": "Germany",
29
                    "visits": 1322
30
                },
31
                {
32
                    "country": "UK",
33
                    "visits": 1122
34
                },
35
                {
36
                    "country": "France",
37
                    "visits": 1114
38
                },
39
                {
40
                    "country": "India",
41
                    "visits": 984
42
                },
43
                {
44
                    "country": "Spain",
45
                    "visits": 711
46
                },
47
                {
48
                    "country": "Netherlands",
49
                    "visits": 665
50
                },
51
                {
52
                    "country": "Russia",
53
                    "visits": 580
54
                },
55
                {
56
                    "country": "South Korea",
57
                    "visits": 443
58
                },
59
                {
60
                    "country": "Canada",
61
                    "visits": 441
62
                },
63
                {
64
                    "country": "Brazil",
65
                    "visits": 395
66
                },
67
                {
68
                    "country": "Italy",
69
                    "visits": 386
70
                },
71
                {
72
                    "country": "Australia",
73
                    "visits": 384
74
                },
75
                {
76
                    "country": "Taiwan",
77
                    "visits": 338
78
                },
79
                {
80
                    "country": "Poland",
81
                    "visits": 328
82
                }
83
            ];
84
 
85
 
86
            AmCharts.ready(function () {
87
                // SERIAL CHART
88
                chart = new AmCharts.AmSerialChart();
89
                chart.dataProvider = chartData;
90
                chart.categoryField = "country";
91
                chart.startDuration = 1;
92
 
93
                // AXES
94
                // category
95
                var categoryAxis = chart.categoryAxis;
96
                categoryAxis.labelRotation = 90;
97
                categoryAxis.gridPosition = "start";
98
 
99
                // value
100
                // in case you don't want to change default settings of value axis,
101
                // you don't need to create it, as one value axis is created automatically.
102
 
103
                // GRAPH
104
                var graph = new AmCharts.AmGraph();
105
                graph.valueField = "visits";
106
                graph.balloonText = "[[category]]: <b>[[value]]</b>";
107
                graph.type = "column";
108
                graph.lineAlpha = 0;
109
                graph.fillAlphas = 0.8;
110
                chart.addGraph(graph);
111
 
112
                // CURSOR
113
                var chartCursor = new AmCharts.ChartCursor();
114
                chartCursor.cursorAlpha = 0;
115
                chartCursor.zoomable = false;
116
                chartCursor.categoryBalloonEnabled = false;
117
                chart.addChartCursor(chartCursor);
118
 
119
                chart.creditsPosition = "top-right";
120
 
121
                chart.write("chartdiv");
122
            });
123
        </script>
124
    </head>
125
 
126
    <body>
127
        <div id="chartdiv" style="width: 100%; height: 400px;"></div>
128
    </body>
129
 
130
</html>