X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=tests%2Flinear-regression-addseries.html;h=c77020d9ba17cb5df4e1d79ba8788b3c6373e331;hb=f160e4ac8166f74d1f0e5604061564fbca5ba5a5;hp=ccbc28d2be5a6ad404972014136392ac927110da;hpb=dea29a4d4be3876830153021ed8825745dfcead9;p=dygraphs.git diff --git a/tests/linear-regression-addseries.html b/tests/linear-regression-addseries.html index ccbc28d..c77020d 100644 --- a/tests/linear-regression-addseries.html +++ b/tests/linear-regression-addseries.html @@ -1,15 +1,10 @@ - + Linear Regression - - - - - + + @@ -86,6 +81,10 @@ updateChart(); } + function toHex(rgb) { + return 'rgb(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ')'; + } + function updateChart() { // Generate a new data set with the regression lines. var new_labels = []; @@ -98,11 +97,11 @@ // Darken the series by 50% to generate its regression. var label = labels[i] + " Regression"; new_labels.push(label); - var c = new RGBColor(orig_colors[i - 1]); + var c = Dygraph.toRGB_(orig_colors[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)); - new_colors.push(c.toHex()); + new_colors.push(toHex(c)); new_opts[label] = { drawPoints: false, strokeWidth: 1.0