Modifying the numericTicks algorithm to include the last 'nice' tick
[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 <!--
10 For production (minified) code, use:
11 <script type="text/javascript" src="dygraph-combined.js"></script>
12 -->
13 <script type="text/javascript" src="../dygraph-dev.js"></script>
14
15 </head>
16 <body>
17 <p>dateWindow is set to something other than an x-value in the data set.
18 Grid lines should still go through data points. In the second chart, there
19 should be lines going off the edge of the chart (to data points out of
20 view).</p>
21
22 <div id="div_g1" style="width:900px; height:300px;"></div>
23 <div id="div_g2" style="width:900px; height:300px;"></div>
24
25 <script type="text/javascript">
26 var data = [];
27 for (var i = 1; i < 10; i++) {
28 data.push([new Date("2009/10/0" + i), i%2, i%3]);
29 }
30
31 g1 = new Dygraph(
32 document.getElementById("div_g1"),
33 data, {
34 dateWindow: [ Date.parse("2009/09/29 12:00:00"),
35 Date.parse("2009/10/10 12:00:00") ],
36 labels: [ 'Date', 'Y1', 'Y2' ]
37 }
38 );
39
40 g2 = new Dygraph(
41 document.getElementById("div_g2"),
42 data, {
43 dateWindow: [ Date.parse("2009/10/01 12:00:00"),
44 Date.parse("2009/10/08 12:00:00") ],
45 labels: [ 'Date', 'Y1', 'Y2' ]
46 }
47 );
48 </script>
49 </body>
50 </html>