Subversion-Projekte lars-tiefland.cienc

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
9 lars 1
<!DOCTYPE HTML>
2
<html>
3
	<head>
4
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
		<title>Highcharts Example</title>
6
 
7
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
8
		<style type="text/css">
9
${demo.css}
10
		</style>
11
		<script type="text/javascript">
12
$(function () {
13
 
14
    $('#container').highcharts({
15
 
16
        chart: {
17
            type: 'gauge',
18
            plotBackgroundColor: null,
19
            plotBackgroundImage: null,
20
            plotBorderWidth: 0,
21
            plotShadow: false
22
        },
23
 
24
        title: {
25
            text: 'Speedometer'
26
        },
27
 
28
        pane: {
29
            startAngle: -150,
30
            endAngle: 150,
31
            background: [{
32
                backgroundColor: {
33
                    linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
34
                    stops: [
35
                        [0, '#FFF'],
36
                        [1, '#333']
37
                    ]
38
                },
39
                borderWidth: 0,
40
                outerRadius: '109%'
41
            }, {
42
                backgroundColor: {
43
                    linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
44
                    stops: [
45
                        [0, '#333'],
46
                        [1, '#FFF']
47
                    ]
48
                },
49
                borderWidth: 1,
50
                outerRadius: '107%'
51
            }, {
52
                // default background
53
            }, {
54
                backgroundColor: '#DDD',
55
                borderWidth: 0,
56
                outerRadius: '105%',
57
                innerRadius: '103%'
58
            }]
59
        },
60
 
61
        // the value axis
62
        yAxis: {
63
            min: 0,
64
            max: 200,
65
 
66
            minorTickInterval: 'auto',
67
            minorTickWidth: 1,
68
            minorTickLength: 10,
69
            minorTickPosition: 'inside',
70
            minorTickColor: '#666',
71
 
72
            tickPixelInterval: 30,
73
            tickWidth: 2,
74
            tickPosition: 'inside',
75
            tickLength: 10,
76
            tickColor: '#666',
77
            labels: {
78
                step: 2,
79
                rotation: 'auto'
80
            },
81
            title: {
82
                text: 'km/h'
83
            },
84
            plotBands: [{
85
                from: 0,
86
                to: 120,
87
                color: '#55BF3B' // green
88
            }, {
89
                from: 120,
90
                to: 160,
91
                color: '#DDDF0D' // yellow
92
            }, {
93
                from: 160,
94
                to: 200,
95
                color: '#DF5353' // red
96
            }]
97
        },
98
 
99
        series: [{
100
            name: 'Speed',
101
            data: [80],
102
            tooltip: {
103
                valueSuffix: ' km/h'
104
            }
105
        }]
106
 
107
    },
108
        // Add some life
109
        function (chart) {
110
            if (!chart.renderer.forExport) {
111
                setInterval(function () {
112
                    var point = chart.series[0].points[0],
113
                        newVal,
114
                        inc = Math.round((Math.random() - 0.5) * 20);
115
 
116
                    newVal = point.y + inc;
117
                    if (newVal < 0 || newVal > 200) {
118
                        newVal = point.y - inc;
119
                    }
120
 
121
                    point.update(newVal);
122
 
123
                }, 3000);
124
            }
125
        });
126
});
127
		</script>
128
	</head>
129
	<body>
130
<script src="../../js/highcharts.js"></script>
131
<script src="../../js/highcharts-more.js"></script>
132
<script src="../../js/modules/exporting.js"></script>
133
 
134
<div id="container" style="min-width: 310px; max-width: 400px; height: 300px; margin: 0 auto"></div>
135
 
136
	</body>
137
</html>