works
authorDan Vanderkam <danvdk@gmail.com>
Thu, 21 Oct 2010 12:41:30 +0000 (08:41 -0400)
committerDan Vanderkam <danvdk@gmail.com>
Thu, 21 Oct 2010 12:41:30 +0000 (08:41 -0400)
tests/linear-regression.html

index 93d95d9..6ccc94e 100644 (file)
 
           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;
           var x2 = range[1];
           var y2 = a * x2 + b;
 
+          // Scale up to percentages, rather than fractions.
+          y1 *= 100;
+          y2 *= 100;
+
           var p1 = g.toDomCoords(x1, y1);
           var p2 = g.toDomCoords(x2, y2);