Merge branch 'master' of https://github.com/kberg/dygraphs
[dygraphs.git] / tests / dateWindow.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
5 <title>dateWindow</title>
6 <!--[if IE]>
7 <script type="text/javascript" src="../excanvas.js"></script>
8 <![endif]-->
9 <script type="text/javascript" src="../strftime/strftime-min.js"></script>
10 <script type="text/javascript" src="../rgbcolor/rgbcolor.js"></script>
11 <script type="text/javascript" src="../dygraph-canvas.js"></script>
12 <script type="text/javascript" src="../dygraph.js"></script>
13 </head>
14 <body>
15 <p>dateWindow is set to something other than an x-value in the data set.
16 Grid lines should still go through data points. In the second chart, there
17 should be lines going off the edge of the chart (to data points out of
18 view).</p>
19
20 <div id="div_g1" style="width:900px; height:300px;"></div>
21 <div id="div_g2" style="width:900px; height:300px;"></div>
22
23 <script type="text/javascript">
24 var data = [];
25 for (var i = 1; i < 10; i++) {
26 data.push([new Date("2009/10/0" + i), i%2, i%3]);
27 }
28
29 g1 = new Dygraph(
30 document.getElementById("div_g1"),
31 data, {
32 dateWindow: [ Date.parse("2009/09/29 12:00:00"),
33 Date.parse("2009/10/10 12:00:00") ]
34 }
35 );
36
37 g2 = new Dygraph(
38 document.getElementById("div_g2"),
39 data, {
40 dateWindow: [ Date.parse("2009/10/01 12:00:00"),
41 Date.parse("2009/10/08 12:00:00") ]
42 }
43 );
44 </script>
45 </body>
46 </html>