Subversion-Projekte lars-tiefland.cienc

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
5 lars 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
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
7
        <title>amCharts Responsive Example</title>
8
        <script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
9
        <script src="http://www.amcharts.com/lib/3/gauge.js"></script>
10
        <script src="../responsive.min.js"></script>
11
        <style>
12
            body,
13
            html {
14
                height: 100%;
15
                padding: 0;
16
                margin: 0;
17
            }
18
        </style>
19
        <script>
20
            var chart = AmCharts.makeChart("chartdiv",
21
            {
22
                "type": "gauge",
23
                "titles": [
24
                {
25
                    "text": "Speedometer",
26
                    "size": 15
27
                }],
28
                "axes": [
29
                {
30
                    "startValue": 0,
31
                    "axisThickness": 1,
32
                    "endValue": 220,
33
                    "valueInterval": 10,
34
                    "bottomTextYOffset": -20,
35
                    "bottomText": "0 km/h",
36
                    "bands": [
37
                    {
38
                        "startValue": 0,
39
                        "endValue": 90,
40
                        "color": "#00CC00"
41
                    },
42
                    {
43
                        "startValue": 90,
44
                        "endValue": 130,
45
                        "color": "#ffac29"
46
                    },
47
                    {
48
                        "startValue": 130,
49
                        "endValue": 220,
50
                        "color": "#ea3838",
51
                        "innerRadius": "95%"
52
                    }]
53
                }],
54
                "arrows": [
55
                {}],
56
                "responsive":
57
                {
58
                    "enabled": true
59
                }
60
            });
61
            setInterval(randomValue, 2000);
62
            // set random value
63
            function randomValue()
64
            {
65
                var value = Math.round(Math.random() * 200);
66
                chart.arrows[0].setValue(value);
67
                chart.axes[0].setBottomText(value + " km/h");
68
            }
69
        </script>
70
    </head>
71
 
72
    <body>
73
        <div id="chartdiv" style="width: 100%; height: 100%;"></div>
74
    </body>
75
 
76
</html>