X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=inline;f=tests%2Flinear-regression.html;h=6a469b8d8290d4193f083aee07e80d5c3aeb4922;hb=c1dbeb10b48e0f805be2cef09efebf5e35218c1a;hp=e3636c12543f5691f80affa948e6bae158e4cba7;hpb=2a07b0ad9869c9116c06fe1c9084da7fec0923bd;p=dygraphs.git
diff --git a/tests/linear-regression.html b/tests/linear-regression.html
index e3636c1..6a469b8 100644
--- a/tests/linear-regression.html
+++ b/tests/linear-regression.html
@@ -2,7 +2,7 @@
Linear Regression
@@ -35,7 +35,8 @@
{
labels: ['X', 'Y1', 'Y2'],
underlayCallback: drawLines,
- drawPoints: true
+ drawPoints: true,
+ strokeWidth: 0.0
}
);
@@ -66,7 +67,7 @@
var b = (sum_y - a * sum_x) / num;
coeffs[series] = [b, a];
- if (console) {
+ if (typeof(console) != 'undefined') {
console.log("coeffs(" + series + "): [" + b + ", " + a + "]");
}
@@ -95,7 +96,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;