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": 3025,
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
 
77
 
78
            AmCharts.ready(function () {
79
                // SERIAL CHART
80
                chart = new AmCharts.AmSerialChart();
81
                chart.dataProvider = chartData;
82
                chart.categoryField = "country";
83
                chart.startDuration = 1;
84
 
85
                // AXES
86
                // category
87
                var categoryAxis = chart.categoryAxis;
88
                categoryAxis.labelRotation = 45; // this line makes category values to be rotated
89
                categoryAxis.gridAlpha = 0;
90
                categoryAxis.fillAlpha = 1;
91
                categoryAxis.fillColor = "#FAFAFA";
92
                categoryAxis.gridPosition = "start";
93
 
94
                // value
95
                var valueAxis = new AmCharts.ValueAxis();
96
                valueAxis.dashLength = 5;
97
                valueAxis.title = "Visitors from country";
98
                valueAxis.axisAlpha = 0;
99
                chart.addValueAxis(valueAxis);
100
 
101
                // GRAPH
102
                var graph = new AmCharts.AmGraph();
103
                graph.valueField = "visits";
104
                graph.colorField = "color";
105
                graph.balloonText = "<b>[[category]]: [[value]]</b>";
106
                graph.type = "column";
107
                graph.lineAlpha = 0;
108
                graph.fillAlphas = 1;
109
                chart.addGraph(graph);
110
 
111
                // CURSOR
112
                var chartCursor = new AmCharts.ChartCursor();
113
                chartCursor.cursorAlpha = 0;
114
                chartCursor.zoomable = false;
115
                chartCursor.categoryBalloonEnabled = false;
116
                chart.addChartCursor(chartCursor);
117
 
118
                chart.creditsPosition = "top-right";
119
 
120
                // WRITE
121
                chart.write("chartdiv");
122
            });
123
        </script>
124
    </head>
125
 
126
    <body>
127
        <div id="chartdiv" style="width: 600px; height: 400px;"></div>
128
    </body>
129
 
130
</html>