From: Dan Vanderkam Date: Thu, 16 Sep 2010 01:19:04 +0000 (-0400) Subject: two different versions; tweak color logic X-Git-Tag: v1.0.0~650 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=34bbe78bab0cfe4a986802aa2e3dc5edbcc55c35;p=dygraphs.git two different versions; tweak color logic --- diff --git a/tests/linear-regression-addseries.html b/tests/linear-regression-addseries.html new file mode 100644 index 0000000..3aa0632 --- /dev/null +++ b/tests/linear-regression-addseries.html @@ -0,0 +1,165 @@ + + + Linear Regression + + + + + + + + +

Linear Regression Demo

+

Click the buttons to generate linear regressions over either data + series. If you zoom in and click the regression button, the regression will + only be run over visible points. Zoom back out to see what the local + regression looks like over the full data.

+ +
+ + + +
+ +

+ +

+ +
+ + diff --git a/tests/linear-regression.html b/tests/linear-regression.html index e3636c1..bed74e0 100644 --- a/tests/linear-regression.html +++ b/tests/linear-regression.html @@ -95,7 +95,11 @@ var p1 = g.toDomCoords(x1, y1); var p2 = g.toDomCoords(x2, y2); - var color = g.getColors()[i - 1]; + var c = new RGBColor(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)); + var color = c.toHex(); ctx.save(); ctx.strokeStyle = color; ctx.lineWidth = 1.0;