Set this for drawCallback
[dygraphs.git] / tests / dateWindow.html
CommitLineData
54425b14 1<!DOCTYPE html>
f6401bf6
DV
2<html>
3 <head>
4 <title>dateWindow</title>
7e5ddc94
DV
5 <!--
6 For production (minified) code, use:
7 <script type="text/javascript" src="dygraph-combined.js"></script>
8 -->
9 <script type="text/javascript" src="../dygraph-dev.js"></script>
10
f6401bf6
DV
11 </head>
12 <body>
13 <p>dateWindow is set to something other than an x-value in the data set.
3d29302c
DV
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>
f6401bf6 17
3d29302c
DV
18 <div id="div_g1" style="width:900px; height:300px;"></div>
19 <div id="div_g2" style="width:900px; height:300px;"></div>
f6401bf6
DV
20
21 <script type="text/javascript">
22 var data = [];
d56573af 23 for (var i = 1; i < 10; i++) {
1e675df1 24 data.push([new Date("2009/10/0" + i), i%2, i%3]);
f6401bf6
DV
25 }
26
3d29302c
DV
27 g1 = new Dygraph(
28 document.getElementById("div_g1"),
29 data, {
30 dateWindow: [ Date.parse("2009/09/29 12:00:00"),
300c5ff0
DV
31 Date.parse("2009/10/10 12:00:00") ],
32 labels: [ 'Date', 'Y1', 'Y2' ]
3d29302c
DV
33 }
34 );
35
36 g2 = new Dygraph(
37 document.getElementById("div_g2"),
38 data, {
39 dateWindow: [ Date.parse("2009/10/01 12:00:00"),
300c5ff0
DV
40 Date.parse("2009/10/08 12:00:00") ],
41 labels: [ 'Date', 'Y1', 'Y2' ]
3d29302c
DV
42 }
43 );
f6401bf6
DV
44 </script>
45 </body>
46</html>