-
Notifications
You must be signed in to change notification settings - Fork 0
/
content.html
41 lines (41 loc) · 1.47 KB
/
content.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<html>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<head>
<title>Συνεχής Επιτήρηση Υδραυλικής Πίεσης</title>
<style type="text/css">
body {
font-family:verdana,arial,sans-serif;
font-size:10pt;
margin:30px;
background-color:#7CFC00;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript' src='http://dygraphs.com/1.0.1/dygraph-combined.js'></script>
<script type='text/javascript'>
function drawChart() {
var url_='http://mez5.dyndns.org:22226/test.js?query=CurVal';
var curval=0;
var maxval=0;
var minval=1000;
var data2 = [];
jQuery.get(url_,function (data) {curval=1*data;},'text');
var g = new Dygraph(document.getElementById("div_g"), data2,{drawPoints: true,showRoller: true,valueRange: [300, 600],labels: ['Time', 'kPa']});
var run = setInterval(function() {
jQuery.get(url_,function (data) {curval=1*data;},'text');
if (curval>maxval) {maxval=curval;}
if (curval<minval) {minval=curval;}
var x = new Date(); // current time
var y=1*curval;
data2.push([x, y]);
g.updateOptions( { 'valueRange': [minval,maxval] } );
g.updateOptions( { 'file': data2 } );
}, 10000);
}
</script>
</head>
<body onload='drawChart()'>
<div id="div_g" style="width:1250px; height:500px;"></div>
</body>
</html>