Merge pull request #135 from klausw-g/highlight-NaN-3
[dygraphs.git] / tests / hourly.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
5 <title>hourly</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>Hourly data:</p>
18 <div id="div_g" style="width:600px; height:300px;"></div>
19
20 <p>Minutely data:</p>
21 <div id="div_gm" style="width:600px; height:300px;"></div>
22
23 <p>Secondly data:</p>
24 <div id="div_gs" style="width:600px; height:300px;"></div>
25
26 <script type="text/javascript">
27 g = new Dygraph(
28 document.getElementById("div_g"),
29 function HourlyData() {
30 return "" +
31 "Date,A,B\n" +
32 "2009/07/12 00:00:00,3,4\n" +
33 "2009/07/12 01:00:00,5,6\n" +
34 "2009/07/12 02:00:00,7,6\n" +
35 "2009/07/12 03:00:00,6,5\n" +
36 "2009/07/12 04:00:00,4,7\n" +
37 "2009/07/12 05:00:00,3,6\n" +
38 "2009/07/12 06:00:00,4,6"
39 }
40 );
41
42 gm = new Dygraph(
43 document.getElementById("div_gm"),
44 function() {
45 var ret = "Date,Hours,Minutes\n";
46 var zp = function(x) { if (x<10) return "0"+x; else return ""+x;};
47 for (var d = 0; d <= 1; d++) {
48 for (var h = 0; h < 24; h++) {
49 for (var m = 0; m < 60; m++) {
50 ret += "2008/07/" + zp(12 + d) + " " + zp(h) + ":" + zp(m) +
51 "," + (24*d + h) + "," + m + "\n";
52 }
53 }
54 }
55 return ret;
56 }
57 );
58
59 gs = new Dygraph(
60 document.getElementById("div_gs"),
61 function() {
62 var ret = "Date,Minutes,Seconds\n";
63 var zp = function(x) { if (x<10) return "0"+x; else return ""+x;};
64 for (var h = 0; h <= 1; h++) {
65 for (var m = 0; m < 60; m++) {
66 for (var s = 0; s < 60; s++) {
67 ret += "2008/07/01 " + zp(h) + ":" + zp(m) + ":" + zp(s) +
68 "," + (h*60 + m) + "," + s + "\n";
69 }
70 }
71 }
72 return ret;
73 }
74 );
75 </script>
76 </body>
77 </html>