X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=tests%2Flinear-regression-fractions.html;h=c5728a9759ae5b4e09539b6177fd90e196a67829;hb=fd6b8dadbaa0614671bef1508c23d6a932e25081;hp=74be0b921e456b0a61c5034b08dcdc3a3d344e4d;hpb=10494b48b43d9ca8710d441d3c530c7d546f3edf;p=dygraphs.git diff --git a/tests/linear-regression-fractions.html b/tests/linear-regression-fractions.html index 74be0b9..c5728a9 100644 --- a/tests/linear-regression-fractions.html +++ b/tests/linear-regression-fractions.html @@ -1,15 +1,10 @@ - + Linear Regression - - - - - + + @@ -40,7 +35,8 @@ drawPoints: true, strokeWidth: 0.0, fractions: true, - errorBars: true + errorBars: true, + pointSize: 1 } ); @@ -87,6 +83,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. @@ -108,14 +108,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]);