- Merge branch 'master' of http://github.com/danvk/dygraphs
[dygraphs.git] / tests / linear-regression.html
index bed74e0..95177e3 100644 (file)
@@ -1,8 +1,10 @@
+<!DOCTYPE html>
 <html>
   <head>
+    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
     <title>Linear Regression</title>
     <!--[if IE]>
-    <script type="text/javascript" src="excanvas.js"></script>
+    <script type="text/javascript" src="../excanvas.js"></script>
     <![endif]-->
     <script type="text/javascript" src="../strftime/strftime-min.js"></script>
     <script type="text/javascript" src="../rgbcolor/rgbcolor.js"></script>
@@ -35,7 +37,8 @@
               {
                 labels: ['X', 'Y1', 'Y2'],
                 underlayCallback: drawLines,
-                drawPoints: true
+                drawPoints: true,
+                strokeWidth: 0.0
               }
           );
 
 
           var y = g.getValue(i, series);
           if (y == null) continue;
+          if (y.length == 2) {
+            // using fractions
+            y = y[0] / y[1];
+          }
 
           num++;
           sum_x += x;
@@ -66,7 +73,7 @@
         var b = (sum_y - a * sum_x) / num;
 
         coeffs[series] = [b, a];
-        if (console) {
+        if (typeof(console) != 'undefined') {
           console.log("coeffs(" + series + "): [" + b + ", " + a + "]");
         }