-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathexample5.html
186 lines (162 loc) · 6.17 KB
/
example5.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Example 5</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 5</small>
</h3>
<p>This examples shares majority of javascript and setup as <a href="index.html">previous examples</a>, but shows a 2nd
y-axis and adds support for plotting multiple independent series.</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/example5.html">example5.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.Demo5Page.js">j/JGS.Demo5Page.js</a>
</dt>
<dd>Contains all of the Dygraphs specific handling. The majority of this file is the
same as previous examples, however, additional setup and formatting has been added to load multiple series and show
a 2nd y-axis.
</dd>
</dl>
<dl>
<dt><a
href="https://github.com/kaliatech/dygraphs-dynamiczooming-example/blob/master/j/JGS.GraphDataProviderMultiSeries.js">j/JGS.GraphDataProviderMultiSeries.js</a>
</dt>
<dd>This is a new class created for this example. It is a more generic version of the same class used in
previous examples for getting range and detail data from the server/simulator and aggregating,splicing,
and converting it for dygraphs. What this class adds is support for combining multiple series in to a
single dataset useable by dygraphs even when the time axis does not align between the series. For details,
see comments and code around the
<a href="https://github.com/kaliatech/dygraphs-dynamiczooming-example/blob/master/j/JGS.GraphDataProviderMultiSeries.js">JGS.Demo5Page._combineSeries</a>
method.
</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 all the other It was modified
slightly while building this example so that multiple series have different trending and value ranges.
</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">
© 2014 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.GraphDataProviderMultiSeries.js"></script>
<script src="j/JGS.Demo5Page.js"></script>
<script>
$(document).ready(function () {
var pageCfg = {
$graphCont: $("#graph-cont-1"),
$rangeBtnsCont: $("#range-btns-cont-1")
};
var demo5Page = new JGS.Demo5Page(pageCfg);
demo5Page.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>