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/radar.js" type="text/javascript"></script>
10
 
11
        <script>
12
            var chart;
13
 
14
            var chartData = [
15
                {
16
                    "direction": "N",
17
                    "value": 8
18
                },
19
                {
20
                    "direction": "NE",
21
                    "value": 9
22
                },
23
                {
24
                    "direction": "E",
25
                    "value": 4.5
26
                },
27
                {
28
                    "direction": "SE",
29
                    "value": 3.5
30
                },
31
                {
32
                    "direction": "S",
33
                    "value": 9.2
34
                },
35
                {
36
                    "direction": "SW",
37
                    "value": 8.4
38
                },
39
                {
40
                    "direction": "W",
41
                    "value": 11.1
42
                },
43
                {
44
                    "direction": "NW",
45
                    "value": 10
46
                }
47
            ];
48
 
49
 
50
            AmCharts.ready(function () {
51
                // RADAR CHART
52
                chart = new AmCharts.AmRadarChart();
53
                chart.dataProvider = chartData;
54
                chart.categoryField = "direction";
55
                chart.startDuration = 1;
56
 
57
                // TITLE
58
                chart.addTitle("Prevailing winds", 15);
59
 
60
                // VALUE AXIS
61
                var valueAxis = new AmCharts.ValueAxis();
62
                valueAxis.gridType = "circles";
63
                valueAxis.fillAlpha = 0.05;
64
                valueAxis.fillColor = "#000000";
65
                valueAxis.axisAlpha = 0.2;
66
                valueAxis.gridAlpha = 0;
67
                valueAxis.fontWeight = "bold";
68
                valueAxis.minimum = 0;
69
                chart.addValueAxis(valueAxis);
70
 
71
                // GRAPH
72
                var graph = new AmCharts.AmGraph();
73
                graph.lineColor = "#FFCC00";
74
                graph.fillAlphas = 0.4;
75
                graph.bullet = "round";
76
                graph.valueField = "value";
77
                graph.balloonText = "[[category]]: [[value]] m/s";
78
                chart.addGraph(graph);
79
 
80
                // GUIDES
81
                // blue fill
82
                var guide = new AmCharts.Guide();
83
                guide.angle = 225;
84
                guide.tickLength = 0;
85
                guide.toAngle = 315;
86
                guide.value = 0;
87
                guide.toValue = 14;
88
                guide.fillColor = "#0066CC";
89
                guide.fillAlpha = 0.6;
90
                valueAxis.addGuide(guide);
91
 
92
                // red fill
93
                guide = new AmCharts.Guide();
94
                guide.angle = 45;
95
                guide.tickLength = 0;
96
                guide.toAngle = 135;
97
                guide.value = 0;
98
                guide.toValue = 14;
99
                guide.fillColor = "#CC3333";
100
                guide.fillAlpha = 0.6;
101
                valueAxis.addGuide(guide);
102
 
103
                // WRITE
104
                chart.write("chartdiv");
105
            });
106
        </script>
107
    </head>
108
 
109
    <body>
110
        <div id="chartdiv" style="width:600px; height:400px;"></div>
111
    </body>
112
 
113
</html>