forked from danvk/dygraphs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
straw-broom.html
65 lines (62 loc) · 1.69 KB
/
straw-broom.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Straw broom charts demo</title>
<link rel="stylesheet" type="text/css" href="../dist/dygraph.css" />
<link rel="stylesheet" type="text/css" href="../common/vextlnk.css" />
<script type="text/javascript" src="../dist/dygraph.js"></script>
<script type="text/javascript" src="../extras/synchronizer.js"></script>
<script type="text/javascript" src="../extras/rebase.js"></script>
<script type="text/javascript" src="data.js"></script>
<style type="text/css">
#g1, #g2, #g3 {
width: 500px;
height: 300px;
}
</style>
</head>
<body>
<table>
<thead>
<caption>Hover, click and zoom to test the rebase:</caption>
</thead>
<tbody>
<tr>
<td>
<h2>Value:</h2>
<div id="g1"></div>
</td>
<td>
<h2>Percent:</h2>
<div id="g2"></div>
</td>
</tr>
<tr>
<td>
<h2>None:</h2>
<div id="g3"></div>
</td>
</tr>
</tbody>
</table>
<script type="text/javascript"><!--//--><![CDATA[//><!--
Dygraph.onDOMready(function onDOMready() {
var gs = [];
var rebaseOpts = [100, 'percent', null];
for (var i = 1; i <= 3; i++) {
var baseOpt = rebaseOpts.shift();
var rebase = new Dygraph.Plugins.Rebase(baseOpt);
gs.push(
new Dygraph(
document.getElementById("g" + i),
stockData,
{ plugins: [rebase] }
)
);
}
Dygraph.synchronize(gs, { range: false });
});
//--><!]]></script>
</body>
</html>