X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=inline;f=tests%2Flinear-regression-fractions.html;h=284e2abab6e9fbf98f5d0e9939480858a2bcfa90;hb=b642c6ca0cf56d953a09f04515fbae326907278e;hp=6ccc94e4564558afe306877096797a7b316fd9c3;hpb=3a8dc464e8e7b197d7df18220ab2ad189ff95841;p=dygraphs.git
diff --git a/tests/linear-regression-fractions.html b/tests/linear-regression-fractions.html
index 6ccc94e..284e2ab 100644
--- a/tests/linear-regression-fractions.html
+++ b/tests/linear-regression-fractions.html
@@ -1,13 +1,13 @@
+
Linear Regression
-
-
-
-
-
+
+
+
@@ -38,7 +38,8 @@
drawPoints: true,
strokeWidth: 0.0,
fractions: true,
- errorBars: true
+ errorBars: true,
+ pointSize: 1
}
);
@@ -85,6 +86,10 @@
g.updateOptions({});
}
+ function toHex(rgb) {
+ return 'rgb(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ')';
+ }
+
function drawLines(ctx, area, layout) {
if (typeof(g) == 'undefined') return; // won't be set on the initial draw.
@@ -106,14 +111,14 @@
var p1 = g.toDomCoords(x1, y1);
var p2 = g.toDomCoords(x2, y2);
- var c = new RGBColor(g.getColors()[i - 1]);
+ var c = Dygraph.toRGB_(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();
+ var color = toHex(c);
ctx.save();
ctx.strokeStyle = color;
- ctx.lineWidth = 1.0;
+ ctx.lineWidth = 2.0;
ctx.beginPath();
ctx.moveTo(p1[0], p1[1]);
ctx.lineTo(p2[0], p2[1]);