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