-
Notifications
You must be signed in to change notification settings - Fork 17
/
example3.html
181 lines (157 loc) · 5.6 KB
/
example3.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Example 3</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: 300px;
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 3</small>
</h3>
<p>This example adds pan interaction handling. i.e. Holding SHIFT while dragging the graph. Currently, to handle
the pan interaction we have to hook in to Dygraphs internals. This example is the first time we've had to rely
on non-public Dygraphs variables. This example also differs from previous in that the autoRange for y-axis has
been enabled.</p>
</div>
</div>
<div class="row">
<div class="col-md-12">
<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">
</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/example3.html">example3.html</a>
</dt>
<dd>This page. Contains the graph container's HTML, range selector buttons, and this documentation. No
javascript.
</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 pageCfg = {
$graphCont: $("#graph-cont-1"),
$rangeBtnsCont: $("#range-btns-cont-1")
};
var demo3Page = new JGS.Demo3Page(pageCfg);
demo3Page.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>