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
                chart.depth3D = 50;
85
                chart.angle = 30;
86
                chart.marginRight = -45;
87
 
88
                // AXES
89
                // category
90
                var categoryAxis = chart.categoryAxis;
91
                categoryAxis.gridAlpha = 0;
92
                categoryAxis.axisAlpha = 0;
93
                categoryAxis.gridPosition = "start";
94
 
95
                // value
96
                var valueAxis = new AmCharts.ValueAxis();
97
                valueAxis.axisAlpha = 0;
98
                valueAxis.gridAlpha = 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.5;
108
                graph.lineColor = "#FFFFFF";
109
                graph.topRadius = 1;
110
                graph.fillAlphas = 0.9;
111
                chart.addGraph(graph);
112
 
113
                // CURSOR
114
                var chartCursor = new AmCharts.ChartCursor();
115
                chartCursor.cursorAlpha = 0;
116
                chartCursor.zoomable = false;
117
                chartCursor.categoryBalloonEnabled = false;
118
                chartCursor.valueLineEnabled = true;
119
                chartCursor.valueLineBalloonEnabled = true;
120
                chartCursor.valueLineAlpha = 1;
121
                chart.addChartCursor(chartCursor);
122
 
123
                chart.creditsPosition = "top-right";
124
 
125
                // WRITE
126
                chart.write("chartdiv");
127
            });
128
        </script>
129
    </head>
130
 
131
    <body>
132
        <div id="chartdiv" style="width: 100%; height: 400px;"></div>
133
    </body>
134
 
135
</html>