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