X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=tests%2Flinear-regression-addseries.html;h=81f7f43476e81e6b6dc90eff5d0f5b3ae684f3e3;hb=83008f0ac1a69feb8a23d489cd706b464e69646b;hp=9a20fe8456fdd39b6a7b21092a7fe7be455d5b85;hpb=54425b14df388e9337a1d77876512bb60ba74c3b;p=dygraphs.git diff --git a/tests/linear-regression-addseries.html b/tests/linear-regression-addseries.html index 9a20fe8..81f7f43 100644 --- a/tests/linear-regression-addseries.html +++ b/tests/linear-regression-addseries.html @@ -2,13 +2,12 @@ Linear Regression - - - - - + + + @@ -85,6 +84,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 = []; @@ -97,11 +100,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