X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=tests%2Flinear-regression-fractions.html;h=54c299a692d420584c1dcb8da8ce051ba4b352ef;hb=f6ec7be9627c2dc74776a027349c58f956a99621;hp=2f6e57d86345e1780478e836f05fecb169bbd563;hpb=54425b14df388e9337a1d77876512bb60ba74c3b;p=dygraphs.git diff --git a/tests/linear-regression-fractions.html b/tests/linear-regression-fractions.html index 2f6e57d..54c299a 100644 --- a/tests/linear-regression-fractions.html +++ b/tests/linear-regression-fractions.html @@ -1,14 +1,14 @@ + Linear Regression - - - - - + + + @@ -39,7 +39,8 @@ drawPoints: true, strokeWidth: 0.0, fractions: true, - errorBars: true + errorBars: true, + pointSize: 1 } ); @@ -86,6 +87,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. @@ -107,14 +112,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]);