forked from electronut/pp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtime-flot.html
50 lines (48 loc) · 1.22 KB
/
time-flot.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
42
43
44
45
46
47
48
49
50
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>TimeFlot</title>
<style>
.demo-placeholder {
width: 80%;
height: 80%;
}
</style>
<script language="javascript" type="text/javascript"
src="flot/jquery.js"></script>
<script language="javascript" type="text/javascript"
src="flot/jquery.flot.js"></script>
<script language="javascript" type="text/javascript"
src="flot/jquery.flot.time.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
// plot options
var options = {
series: {
lines: {
show: true
},
points: {
show: true
}
},
xaxis: {mode: "time", timeformat: "%m-%y-%H::%M::%S"}
};
// create plot
var data = [];
t = (new Date()).getTime()
for(var i = 0; i < 500; i ++) {
data.push([t, Math.exp(-i/100)*Math.sin(Math.PI*i/10)]);
t = t + 1000;
}
var plot = $.plot("#placeholder", [data], options);
});
</script>
</head>
<body>
<h3>A Time Series Flot</h3>
<div class="demo-container">
<div id="placeholder" class="demo-placeholder"></div>
</div>
</body>
</html>