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/gauge.js" type="text/javascript"></script>
10
 
11
        <script>
12
            var chart;
13
            var arrow;
14
            var axis;
15
 
16
            AmCharts.ready(function () {
17
                // create angular gauge
18
                chart = new AmCharts.AmAngularGauge();
19
                chart.addTitle("Speedometer");
20
 
21
                // create axis
22
                axis = new AmCharts.GaugeAxis();
23
                axis.startValue = 0;
24
				axis.axisThickness = 1;
25
                axis.valueInterval = 10;
26
                axis.endValue = 220;
27
                // color bands
28
                var band1 = new AmCharts.GaugeBand();
29
                band1.startValue = 0;
30
                band1.endValue = 90;
31
                band1.color = "#00CC00";
32
 
33
                var band2 = new AmCharts.GaugeBand();
34
                band2.startValue = 90;
35
                band2.endValue = 130;
36
                band2.color = "#ffac29";
37
 
38
                var band3 = new AmCharts.GaugeBand();
39
                band3.startValue = 130;
40
                band3.endValue = 220;
41
                band3.color = "#ea3838";
42
                band3.innerRadius = "95%";
43
 
44
                axis.bands = [band1, band2, band3];
45
 
46
                // bottom text
47
                axis.bottomTextYOffset = -20;
48
                axis.setBottomText("0 km/h");
49
                chart.addAxis(axis);
50
 
51
                // gauge arrow
52
                arrow = new AmCharts.GaugeArrow();
53
                chart.addArrow(arrow);
54
 
55
                chart.write("chartdiv");
56
                // change value every 2 seconds
57
                setInterval(randomValue, 2000);
58
            });
59
 
60
            // set random value
61
            function randomValue() {
62
                var value = Math.round(Math.random() * 200);
63
                arrow.setValue(value);
64
                axis.setBottomText(value + " km/h");
65
            }
66
 
67
        </script>
68
    </head>
69
 
70
    <body>
71
        <div id="chartdiv" style="width:500px; height:400px;"></div>
72
    </body>
73
 
74
</html>