From c5a3744991be4af378d64dac5730119ddb2f2d82 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Thu, 21 Oct 2010 08:41:30 -0400 Subject: [PATCH] works --- tests/linear-regression.html | 8 ++++++++ 1 file changed, 8 insertions(+) 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); -- 2.7.4