This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_smokeping.html
56 lines (47 loc) · 1.91 KB
/
test_smokeping.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
51
52
53
54
55
56
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Flot Examples</title>
<link href="layout.css" rel="stylesheet" type="text/css" />
<!--[if IE]><script language="javascript" type="text/javascript" src="../excanvas.pack.js"></script><![endif]-->
<script language="javascript" type="text/javascript" src="public/javascripts/jquery-1.4.min.js"></script>
<script language="javascript" type="text/javascript" src="public/javascripts/jquery.flot.js"></script>
</head>
<body>
<h1>Flot Examples</h1>
<div id="placeholder" style="width:1200px;height:300px;"></div>
<p>Simple example. You don't need to specify much to get an
attractive look. Put in a placeholder, make sure you set its
dimensions (otherwise the plot library will barf) and call the
plot function with the data. The axes are automatically
scaled.</p>
<script id="source" language="javascript" type="text/javascript">
$(function () {
var base = [];
var variations = [];
var dummy_count = 10;
for(var i= 0; i< dummy_count; i++){ variations[i] = []; }
for (var i = 0; i < 10; i += 0.5){
var v = Math.sin(i);
base.push([i, v]);
var n = 0;
for(n= 0; n< dummy_count / 3; n++){
variations[n].push([n, v + Math.random()*2])
}
for(; n< dummy_count; n++){
variations[n].push([n, v + Math.random()*5])
}
}
var datas = [];
for(var i= 0; i< dummy_count; i++){
datas.push( {bars: {show: true, barWidth: 0.5, fillOpacity: 0.05}, color: "#afd8f8", data: variations[i]} );
}
$.plot($("#placeholder"), $.merge(datas, [
{bars: {show: true, fill: false}, color: 'red', data: base},
{lines: {lineWidth: 10}, data: base}
]));
});
</script>
</body>
</html>