Merge branch 'master' of github.com:danvk/dygraphs
[dygraphs.git] / tests / range-selector.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
5 <title>Temperatures with Range Selector</title>
6 <!--[if IE]>
7 <script type="text/javascript" src="../excanvas.js"></script>
8 <![endif]-->
9 <!--
10 For production (minified) code, use:
11 <script type="text/javascript" src="dygraph-combined.js"></script>
12 -->
13 <script type="text/javascript" src="../dygraph-dev.js"></script>
14
15 <script type="text/javascript" src="data.js"></script>
16 <style type="text/css">
17 #bordered {
18 border: 1px solid red;
19 }
20 </style>
21 </head>
22 <body>
23 <p>Demo of a graph with the range selector.</p>
24 <p>
25 No roll period.
26 </p>
27 <div id="noroll" style="width:800px; height:320px;"></div>
28 <p>
29 Roll period of 14 timesteps, custom range selector height and plot color.
30 </p>
31 <div id="roll14" style="width:800px; height:320px;"></div>
32 <script type="text/javascript">
33 g1 = new Dygraph(
34 document.getElementById("noroll"),
35 data_temp,
36 {
37 customBars: true,
38 title: 'Daily Temperatures in New York vs. San Francisco',
39 ylabel: 'Temperature (F)',
40 legend: 'always',
41 labelsDivStyles: { 'textAlign': 'right' },
42 showRangeSelector: true
43 }
44 );
45 g2 = new Dygraph(
46 document.getElementById("roll14"),
47 data_temp,
48 {
49 rollPeriod: 14,
50 showRoller: true,
51 customBars: true,
52 title: 'Daily Temperatures in New York vs. San Francisco',
53 ylabel: 'Temperature (F)',
54 legend: 'always',
55 labelsDivStyles: { 'textAlign': 'right' },
56 xAxisHeight: 14,
57 showRangeSelector: true,
58 rangeSelectorHeight: 30,
59 rangeSelectorPlotStrokeColor: 'yellow',
60 rangeSelectorPlotFillColor: 'lightyellow'
61 }
62 );
63 </script>
64 </body>
65 </html>