Merge branch 'master' of http://github.com/nealie/dygraphs
[dygraphs.git] / tests / hourly.html
CommitLineData
2769de62
DV
1<html>
2 <head>
6f091595 3 <title>hourly</title>
2769de62 4 <!--[if IE]>
a2b2c3a1 5 <script type="text/javascript" src="../excanvas.js"></script>
2769de62 6 <![endif]-->
d37dca40
DV
7 <script type="text/javascript" src="../strftime/strftime-min.js"></script>
8 <script type="text/javascript" src="../rgbcolor/rgbcolor.js"></script>
285a6bda 9 <script type="text/javascript" src="../dygraph-canvas.js"></script>
2769de62 10 <script type="text/javascript" src="../dygraph.js"></script>
2769de62
DV
11 </head>
12 <body>
13 <p>Hourly data:</p>
d16579a0 14 <div id="div_g" style="width:600px; height:300px;"></div>
2769de62 15
6b8e33dd 16 <p>Minutely data:</p>
d16579a0 17 <div id="div_gm" style="width:600px; height:300px;"></div>
6b8e33dd 18
328bb812 19 <p>Secondly data:</p>
d16579a0 20 <div id="div_gs" style="width:600px; height:300px;"></div>
328bb812 21
2769de62 22 <script type="text/javascript">
285a6bda 23 g = new Dygraph(
d16579a0 24 document.getElementById("div_g"),
79420a1e
DV
25 function HourlyData() {
26 return "" +
27 "Date,A,B\n" +
28 "2009/07/12 00:00:00,3,4\n" +
29 "2009/07/12 01:00:00,5,6\n" +
30 "2009/07/12 02:00:00,7,6\n" +
31 "2009/07/12 03:00:00,6,5\n" +
32 "2009/07/12 04:00:00,4,7\n" +
33 "2009/07/12 05:00:00,3,6\n" +
34 "2009/07/12 06:00:00,4,6"
285a6bda 35 }
2769de62 36 );
6b8e33dd 37
285a6bda 38 gm = new Dygraph(
d16579a0 39 document.getElementById("div_gm"),
6b8e33dd
DV
40 function() {
41 var ret = "Date,Hours,Minutes\n";
42 var zp = function(x) { if (x<10) return "0"+x; else return ""+x;};
62c68d8f
DV
43 for (var d = 0; d <= 1; d++) {
44 for (var h = 0; h < 24; h++) {
45 for (var m = 0; m < 60; m++) {
46 ret += "2008/07/" + zp(12 + d) + " " + zp(h) + ":" + zp(m) +
47 "," + (24*d + h) + "," + m + "\n";
48 }
6b8e33dd
DV
49 }
50 }
51 return ret;
285a6bda 52 }
6b8e33dd 53 );
328bb812 54
285a6bda 55 gs = new Dygraph(
d16579a0 56 document.getElementById("div_gs"),
328bb812
DV
57 function() {
58 var ret = "Date,Minutes,Seconds\n";
59 var zp = function(x) { if (x<10) return "0"+x; else return ""+x;};
60 for (var h = 0; h <= 1; h++) {
61 for (var m = 0; m < 60; m++) {
62 for (var s = 0; s < 60; s++) {
63 ret += "2008/07/01 " + zp(h) + ":" + zp(m) + ":" + zp(s) +
64 "," + (h*60 + m) + "," + s + "\n";
65 }
66 }
67 }
68 return ret;
285a6bda 69 }
328bb812 70 );
2769de62
DV
71 </script>
72 </body>
73</html>