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