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
 
13
            var chart = AmCharts.makeChart("chartdiv", {
14
                type: "gauge",
15
                titles: [{
16
                    "text": "Speedometer",
17
                    "size": 15
18
                }],
19
 
20
                axes: [{
21
                    startValue: 0,
22
                    axisThickness: 1,
23
                    endValue: 220,
24
                    valueInterval: 10,
25
                    bottomTextYOffset: -20,
26
                    bottomText: "0 km/h",
27
 
28
                    bands: [{
29
                            startValue: 0,
30
                            endValue: 90,
31
                            color: "#00CC00"
32
                        },
33
 
34
                        {
35
                            startValue: 90,
36
                            endValue: 130,
37
                            color: "#ffac29"
38
                        },
39
 
40
                        {
41
                            startValue: 130,
42
                            endValue: 220,
43
                            color: "#ea3838",
44
                            innerRadius: "95%"
45
                        }
46
                    ]
47
                }],
48
 
49
                arrows: [{}]
50
            });
51
 
52
            setInterval(randomValue, 2000);
53
 
54
             // set random value
55
            function randomValue() {
56
                var value = Math.round(Math.random() * 200);
57
                chart.arrows[0].setValue(value);
58
                chart.axes[0].setBottomText(value + " km/h");
59
            }
60
        </script>
61
    </head>
62
 
63
    <body>
64
        <div id="chartdiv" style="width:500px; height:400px;"></div>
65
    </body>
66
 
67
</html>