Add per-series 'color' option.
[dygraphs.git] / tests / hourly.html
CommitLineData
54425b14 1<!DOCTYPE html>
2769de62
DV
2<html>
3 <head>
10494b48 4 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
6f091595 5 <title>hourly</title>
2769de62 6 <!--[if IE]>
a2b2c3a1 7 <script type="text/javascript" src="../excanvas.js"></script>
2769de62 8 <![endif]-->
7e5ddc94
DV
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
2769de62
DV
15 </head>
16 <body>
17 <p>Hourly data:</p>
d16579a0 18 <div id="div_g" style="width:600px; height:300px;"></div>
2769de62 19
6b8e33dd 20 <p>Minutely data:</p>
d16579a0 21 <div id="div_gm" style="width:600px; height:300px;"></div>
6b8e33dd 22
328bb812 23 <p>Secondly data:</p>
d16579a0 24 <div id="div_gs" style="width:600px; height:300px;"></div>
328bb812 25
2769de62 26 <script type="text/javascript">
285a6bda 27 g = new Dygraph(
d16579a0 28 document.getElementById("div_g"),
79420a1e
DV
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"
285a6bda 39 }
2769de62 40 );
6b8e33dd 41
285a6bda 42 gm = new Dygraph(
d16579a0 43 document.getElementById("div_gm"),
6b8e33dd
DV
44 function() {
45 var ret = "Date,Hours,Minutes\n";
46 var zp = function(x) { if (x<10) return "0"+x; else return ""+x;};
62c68d8f
DV
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 }
6b8e33dd
DV
53 }
54 }
55 return ret;
285a6bda 56 }
6b8e33dd 57 );
328bb812 58
285a6bda 59 gs = new Dygraph(
d16579a0 60 document.getElementById("div_gs"),
328bb812
DV
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;
285a6bda 73 }
328bb812 74 );
2769de62
DV
75 </script>
76 </body>
77</html>