-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
executable file
·81 lines (63 loc) · 2.07 KB
/
test.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
70
71
72
73
74
75
76
77
78
79
80
81
<script type="text/javascript" src="http://dygraphs.com/dygraph-combined.js"></script>
<script type="text/javascript" src="https://jakehosen.github.io/ms/synchronizer.js"></script>
<style type="text/css">
#set_range {
float:left;
width:900px;
height:100px;
}
#wrap {
clear:both;
width:600px;
margin:0 auto;
}
#left_col {
float:left;
display:inline-block;
width:33%;
}
#right_col {
display:inline-block;
width:33%;
}
#center_col {
float:right;
display:inline-block;
width:33%;
}
</style>
<input type="checkbox" id="chk-sync" onchange="update()"><label for="chk-sync">Sync</label>
<div id="g1a" style="width:825px; height:225px;"></div>
<div id="g2a" style="width:825px; height:225px;"></div>
<div id="g3a" style="width:825px; height:250px;"></div>
<script type='text/javascript'>
var sync;
var gs;
window.update = function() {
var chk = document.getElementById('chk-sync').checked;
if(chk) {
sync = Dygraph.synchronize(gs,{range:false});
}
else {
sync.detach();
for (i = 0; i < 3; ++i) {
gs[i].updateOptions({
dateWindow: null,
valueRange: null
});
}
}
}
function data(mul, shift) {
var arr = [];
for (var i = 1; i <= 31; i++) {
arr.push([new Date('2015/01/' + i), Math.sin(i * mul) + shift]);
}
return arr;
}
gs = [
new Dygraph(document.getElementById("g1a"), "ebra_201505_201509.csv", {visibility:[true,true,true,true,true,true,true,true,true], drawXGrid:false, drawYGrid:false, drawPoints:true, strokeWidth:0, pointSize:1.75}),
new Dygraph(document.getElementById("g2a"), "ebra_201505_201509.csv",{visibility:[true,true,true,true,true,true,true,true,true], drawXGrid:false, drawYGrid:false, drawPoints:true, strokeWidth:0, pointSize:1.75}),
new Dygraph(document.getElementById("g3a"), "ebra_201505_201509.csv",{visibility:[true,true,true,true,true,true,true,true,true], drawXGrid:false, drawYGrid:false, drawPoints:true, strokeWidth:0, pointSize:1.75, showRangeSelector:true, interactionModel:Dygraph.defaultInteractionModel})
];
</script>