From: Dan Vanderkam Date: Thu, 21 Oct 2010 12:41:30 +0000 (-0400) Subject: works X-Git-Tag: v1.0.0~625 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=c5a3744991be4af378d64dac5730119ddb2f2d82;p=dygraphs.git works --- diff --git a/tests/linear-regression.html b/tests/linear-regression.html index 93d95d9..6ccc94e 100644 --- a/tests/linear-regression.html +++ b/tests/linear-regression.html @@ -57,6 +57,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; @@ -95,6 +99,10 @@ 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);