X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=sidebyside;f=tests%2Flinear-regression.html;h=d7c3700a0308f627dcef764e987778acedf7a4df;hb=refs%2Fheads%2Fsmall-files-closure;hp=03c95c23b4b870da173a1efb48b2490924a733cf;hpb=4df1af70fa4319dfc6823f3793c6962fac28c9ed;p=dygraphs.git
diff --git a/tests/linear-regression.html b/tests/linear-regression.html
index 03c95c2..d7c3700 100644
--- a/tests/linear-regression.html
+++ b/tests/linear-regression.html
@@ -1,13 +1,17 @@
+
+
Linear Regression
-
-
-
-
+
+
+
@@ -55,6 +59,10 @@
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;
@@ -96,7 +104,7 @@
var p1 = g.toDomCoords(x1, y1);
var p2 = g.toDomCoords(x2, y2);
- var c = new RGBColor(g.getColors()[i - 1]);
+ var c = new RGBColorParser(g.getColors()[i - 1]);
c.r = Math.floor(255 - 0.5 * (255 - c.r));
c.g = Math.floor(255 - 0.5 * (255 - c.g));
c.b = Math.floor(255 - 0.5 * (255 - c.b));