fractions test
authorDan Vanderkam <danvk@google.com>
Tue, 8 Dec 2009 02:30:30 +0000 (18:30 -0800)
committerDan Vanderkam <danvk@google.com>
Tue, 8 Dec 2009 02:30:30 +0000 (18:30 -0800)
tests/fractions.html [new file with mode: 0644]

diff --git a/tests/fractions.html b/tests/fractions.html
new file mode 100644 (file)
index 0000000..845e7ee
--- /dev/null
@@ -0,0 +1,41 @@
+<html>
+  <head>
+    <title>Fractions</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>
+  </head>
+  <body>
+    Fractions:
+    <div id="dg" style="width:600px; height:300px;">Loading...</div>
+
+    With error bars and roller:
+    <div id="dg2" style="width:600px; height:300px;">Loading...</div>
+
+    <script type="text/javascript">
+      var frac_str =
+                  "X,Frac1,Frac2\n" +
+                  "1,1/2,3/4\n"+
+                  "2,1/3,2/3\n"+
+                  "3,2/3,17/49\n"+
+                  "4,25/30,100/200";
+
+      new Dygraph(document.getElementById("dg"),
+                  frac_str,
+                  {
+                    fractions: true
+                  });
+
+      new Dygraph(document.getElementById("dg2"),
+                  frac_str,
+                  {
+                    fractions: true,
+                    errorBars: true,
+                    showRoller: true
+                  });
+    </script>
+  </body>
+</html>