4 <title>Temperatures with Range Selector
</title>
6 For production (minified) code, use:
7 <script type=
"text/javascript" src=
"dygraph-combined.js"></script>
9 <script type=
"text/javascript" src=
"../dygraph-dev.js"></script>
11 <script type=
"text/javascript" src=
"data.js"></script>
12 <style type=
"text/css">
14 border:
1px solid red;
17 background-color: #
101015;
23 <p>Demo of a graph with the range selector.
</p>
27 <div id=
"noroll" style=
"width:800px; height:320px;"></div>
29 <h2 id=
"options">Range selector options
</h2>
30 <p>Here's a view of how the various
<a href=
"../options.html#Range%20Selector">range selector options
</a> affect the display:
</p>
31 <img width=
"954" height=
"354" src=
"range-selector-anatomy.png">
34 Roll period of
14 timesteps, various custom range selector options.
36 <div id=
"roll14" style=
"width:800px; height:320px;"></div>
38 Use the average of a specific subset of series to draw the mini plot (only the first series is used in this test).
39 The default behaviour is to compute the average of
<em>all
</em> series.
41 <div id=
"selectcombined" style=
"width:800px; height:320px;"></div>
44 Demo of range selecor without the chart. (interesting if multiple charts should be synced with one range selector).
46 <div id=
"nochart" style=
"width:800px; height:30px;"></div>
47 <div id=
"dark-background">
48 <p>Demo of range selector on dark background, with (left) and without (right) custom range selector gradient color.
</p>
49 <div id=
"darkbg1" style=
"width:400px; height:300px;display:inline-block;"></div>
50 <div id=
"darkbg2" style=
"width:400px; height:300px;display:inline-block;"></div>
52 <p>Demo of range selector with stepPlot
</p>
53 <div id=
"stepplot" style=
"width:800px; height:320px;"></div>
55 <script type=
"text/javascript">
57 document.getElementById(
"noroll"),
61 title: 'Daily Temperatures in New York vs. San Francisco',
62 ylabel: 'Temperature (F)',
64 labelsDivStyles: { 'textAlign': 'right' },
65 showRangeSelector: true
69 document.getElementById(
"roll14"),
75 title: 'Daily Temperatures in New York vs. San Francisco',
76 ylabel: 'Temperature (F)',
78 labelsDivStyles: { 'textAlign': 'right' },
80 showRangeSelector: true,
81 rangeSelectorHeight:
80,
82 rangeSelectorPlotStrokeColor: 'purple',
83 rangeSelectorPlotFillColor: 'black',
84 rangeSelectorBackgroundStrokeColor: 'orange',
85 rangeSelectorBackgroundLineWidth:
4,
86 rangeSelectorPlotLineWidth:
5,
87 rangeSelectorForegroundStrokeColor: 'brown',
88 rangeSelectorForegroundLineWidth:
8,
89 rangeSelectorAlpha:
0.5,
90 rangeSelectorPlotFillGradientColor: 'red'
94 document.getElementById(
"selectcombined"),
102 title: 'Daily Temperatures in New York vs. San Francisco',
103 ylabel: 'Temperature (F)',
104 showRangeSelector: true,
105 labels: ['X', 'Y1', 'Y2', 'Y3'],
107 'Y1': { showInRangeSelector: true }
112 document.getElementById(
"nochart"),
121 showRangeSelector: true,
122 rangeSelectorHeight:
30
126 document.getElementById(
"darkbg1"),
132 title: 'Nightly Temperatures in NY vs. SF',
133 ylabel: 'Temperature (F)',
135 labelsDivStyles: { 'textAlign': 'right', 'backgroundColor': '#
101015' },
136 showRangeSelector: true,
137 rangeSelectorPlotFillColor: 'MediumSlateBlue',
138 rangeSelectorPlotFillGradientColor: 'rgba(
123,
104,
238,
0)',
139 axisLabelColor: 'white',
145 document.getElementById(
"darkbg2"),
151 title: 'Nightly Temperatures in NY vs. SF',
152 ylabel: 'Temperature (F)',
154 labelsDivStyles: { 'textAlign': 'right', 'backgroundColor': '#
101015' },
155 showRangeSelector: true,
156 rangeSelectorPlotFillColor: 'MediumSlateBlue',
157 axisLabelColor: 'white',
162 g7 = new Dygraph(document.getElementById(
"stepplot"),
164 "2008-05-07,70,30\n" +
165 "2008-05-08,42,88\n" +
166 "2008-05-09,88,42\n" +
167 "2008-05-10,33,37\n" +
168 "2008-05-11,30,35\n",
174 showRangeSelector: true