out of order test
authorDan Vanderkam <danvk@google.com>
Wed, 13 Jan 2010 18:28:58 +0000 (10:28 -0800)
committerDan Vanderkam <danvk@google.com>
Wed, 13 Jan 2010 18:28:58 +0000 (10:28 -0800)
tests/out-of-order.html [new file with mode: 0644]

diff --git a/tests/out-of-order.html b/tests/out-of-order.html
new file mode 100644 (file)
index 0000000..a9e1836
--- /dev/null
@@ -0,0 +1,62 @@
+<html>
+  <head>
+    <title>out of order</title>
+    <!--[if IE]>
+    <script type="text/javascript" src="excanvas.js"></script>
+    <![endif]-->
+    <script type="text/javascript" src="../dygraph-combined.js"></script>
+    <script type="text/javascript" src="../dygraph-canvas.js"></script>
+    <script type="text/javascript" src="../dygraph.js"></script>
+    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
+    <script type="text/javascript">
+      google.load('visualization', '1');
+
+      function createDataTable(dateType) {
+        data = new google.visualization.DataTable();
+        data.addColumn(dateType, 'Date');
+        data.addColumn('number', 'Column A');
+        data.addColumn('number', 'Column B');
+        data.addRows(4);
+        data.setCell(0, 0, new Date("2009/07/15"));
+        data.setCell(0, 1, 3);
+        data.setCell(0, 2, 3);
+        data.setCell(1, 0, new Date("2009/07/22"));
+        data.setCell(1, 1, 4);
+        data.setCell(1, 2, 0);
+        data.setCell(2, 0, new Date("2009/07/08"));
+        data.setCell(2, 1, 2);
+        data.setCell(2, 2, 4);
+        data.setCell(3, 0, new Date("2009/07/01"));
+        data.setCell(3, 1, 1);
+        data.setCell(3, 2, 7);
+        return data;
+      }
+
+      var csv =
+      "Date,Column A,Column B\n" +
+      "2009/07/15,3,3\n" +
+      "2009/07/22,4,0\n" +
+      "2009/07/08,2,4\n" +
+      "2009/07/01,1,7\n";
+
+      function drawVisualization() {
+        data = createDataTable('date');
+
+        new Dygraph.GVizChart(
+            document.getElementById('dygraphs_gviz')).draw(data, {
+            });
+
+        new Dygraph(document.getElementById('dygraphs'), csv);
+
+      }
+      google.setOnLoadCallback(drawVisualization);
+    </script>
+  </head>
+  <body>
+    <p>CSV data source out of order:</p>
+    <div id="dygraphs" style="width:600px; height:300px;"></div>
+
+    <p>gviz data source out of order:</p>
+    <div id="dygraphs_gviz" style="width:600px; height:300px;"></div>
+  </body>
+</html>