forked from danvk/dygraphs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fillGraph.html
69 lines (63 loc) · 1.83 KB
/
fillGraph.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
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
<title>fillGraph</title>
<!--[if IE]>
<script type="text/javascript" src="../excanvas.js"></script>
<![endif]-->
<!--
For production (minified) code, use:
<script type="text/javascript" src="dygraph-combined.js"></script>
-->
<script type="text/javascript" src="../dygraph-dev.js"></script>
</head>
<body>
<p>Filled, no error bars:</p>
<div id="div_g" style="width:600px; height:300px;"></div>
<p>Filled, negatives:</p>
<div id="div_g2" style="width:600px; height:300px;"></div>
<p>Filled on a per-series basis:</p>
<div id="div_g3" style="width:600px; height:300px;"></div>
<script type="text/javascript">
var g1 = new Dygraph(
document.getElementById("div_g"),
function() {
var ret = "X,Y1,Y2\n";
for (var i = 0; i < 100; i++) {
ret += i + "," + i + "," + (i * (100-i) * 100/(50*50)) + "\n";
}
return ret;
},
{ fillGraph: true }
);
var g2 = new Dygraph(
document.getElementById("div_g2"),
function() {
var ret = "X,Y1,Y2\n";
for (var i = 0; i < 100; i++) {
ret += i + "," + (i - 50) +
"," + (50 - i * (100-i) * 100/(50*50)) + "\n";
}
return ret;
},
{ fillGraph: true }
);
var g3 = new Dygraph(
document.getElementById("div_g3"),
function() {
var ret = "X,Y1,Y2\n";
for (var i = 0; i < 100; i++) {
ret += i + "," + i + "," + (i * (100-i) * 100/(50*50)) + "\n";
}
return ret;
},
{
series: {
Y1: { fillGraph: true }
}
}
);
</script>
</body>
</html>