-
Notifications
You must be signed in to change notification settings - Fork 17
/
example4.html
227 lines (195 loc) · 6.91 KB
/
example4.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<!DOCTYPE html>
<html lang="en">
<head>
<title>Example 4</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<style>
.graph-cont {
height: 175px;
width: 100%;
}
h4 {
margin-top: 1em;
}
footer {
margin-bottom: 20px;
}
.content img {
margin: 2em 0;
}
.range-btns-cont {
display: block;
float:right;
visibility: hidden;
margin: 6px 6px;
}
</style>
<body>
<a href="https://github.com/kaliatech/dygraphs-dynamiczooming-example"><img
style="position: absolute; top: 0; right: 0; border: 0;"
src="https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png" alt="Fork me on GitHub"></a>
<div class="container">
<div class="row">
<div class="col-md-12">
<h3>Using Dygraphs to load down-sampled data while zooming
<small> - Example 4</small>
</h3>
<p>Same underlying javascript and setup as <a href="example3.html">example 3</a>, but with multiple graphs on the page. This is primarily a test
as there were originally some issues with multiple graphs when panning because the endPan handling is global to
all DyGraphs instances. See code comments in _setupPanInteractionHandling method. </p>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h3>Graph 1</h3>
<div id="graph-cont-1" class="graph-cont">
</div>
<div>
<span id="range-btns-cont-1" class="btn-group range-btns-cont">
<button name="range-btn-5y" class="btn btn-default btn-mini">
5y
</button>
<button name="range-btn-1y" class="btn btn-default btn-mini">
1y
</button>
<button name="range-btn-ytd" class="btn btn-default btn-mini">
YTD
</button>
<button name="range-btn-6m" class="btn btn-default btn-mini">
6m
</button>
<button name="range-btn-1m" class="btn btn-default btn-mini">
1m
</button>
<button name="range-btn-1w" class="btn btn-default btn-mini">
1w
</button>
<button name="range-btn-1d" class="btn btn-default btn-mini">
1d
</button>
</span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h3>Graph 2</h3>
<div id="graph-cont-2" class="graph-cont">
</div>
<div>
<span id="range-btns-cont-2" class="btn-group range-btns-cont">
<button name="range-btn-5y" class="btn btn-default btn-mini">
5y
</button>
<button name="range-btn-1y" class="btn btn-default btn-mini">
1y
</button>
<button name="range-btn-ytd" class="btn btn-default btn-mini">
YTD
</button>
<button name="range-btn-6m" class="btn btn-default btn-mini">
6m
</button>
<button name="range-btn-1m" class="btn btn-default btn-mini">
1m
</button>
<button name="range-btn-1w" class="btn btn-default btn-mini">
1w
</button>
<button name="range-btn-1d" class="btn btn-default btn-mini">
1d
</button>
</span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
</div>
</div>
<div class="row">
<div class="col-md-12">
<h3>Files</small></h3>
<dl>
<dt><a href="https://github.com/kaliatech/dygraphs-dynamiczooming-example/blob/master/example4.html">example4.html</a>
</dt>
<dd>This page. Contains the graph containers' HTML, range selector buttons, and this documentation. No
javascript except to init the two graph's object instances.
</dd>
</dl>
<dl>
<dt><a href="https://github.com/kaliatech/dygraphs-dynamiczooming-example/blob/master/j/JGS.Demo3Page.js">j/JGS.Demo3Page.js</a>
</dt>
<dd>This is the most relevant file. Contains all of the Dygraphs specific handling. 95% is the same as example 1 & 2.
</dd>
</dl>
<dl>
<dt><a
href="https://github.com/kaliatech/dygraphs-dynamiczooming-example/blob/master/j/JGS.GraphDataProvider.js">j/JGS.GraphDataProvider.js</a>
</dt>
<dd>Responsible for getting range and detail data from the server/simulator and then aggregating,splicing, and
converting it for dygraphs. This file is shared with example 1 & 2.
</dd>
</dl>
<dl>
<dt><a
href="https://github.com/kaliatech/dygraphs-dynamiczooming-example/blob/master/j/JGS.ServerDataSimulator.js">j/JGS.ServerDataSimulator.js</a>
</dt>
<dd>Simulates a remote time series data service. Includes simulated delays. This file is shared with example
1 & 2.
</dd>
</dl>
</div>
</div>
<div class="row">
<div class="col-md-12">
<a href="https://kaliatech.github.io/dygraphs-dynamiczooming-example/">
<span class="glyphicon glyphicon-arrow-left"></span> Back to examples list
</a>
</div>
</div>
<footer>
<hr>
<div class="row">
<div class="col-md-12">
© 2013 JGS Technical LLC
</div>
</div>
</footer>
</div>
<script src="//code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/dygraph/1.1.1/dygraph-combined.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/spin.js/2.3.2/spin.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.17.1/moment.min.js"></script>
<script src="j/JGS.ServerDataSimulator.js"></script>
<script src="j/JGS.GraphDataProvider.js"></script>
<script src="j/JGS.Demo3Page.js"></script>
<script>
$(document).ready(function () {
var pageCfg1 = {
$graphCont: $("#graph-cont-1"),
$rangeBtnsCont: $("#range-btns-cont-1")
};
var demo3Page_graph1 = new JGS.Demo3Page(pageCfg1);
demo3Page_graph1.init();
var pageCfg2 = {
$graphCont: $("#graph-cont-2"),
$rangeBtnsCont: $("#range-btns-cont-2")
};
var demo3Page_graph2 = new JGS.Demo3Page(pageCfg2);
demo3Page_graph2.init();
});
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-8344371-7', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>