X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=tests%2Flinear-regression-addseries.html;h=f44df53c465a5ddf5afa7c437e988b34e4fda1d8;hb=406eddbbdea074df010fc3c432185bc78f9a5814;hp=3fd3a85c01f3a507b8e4870363d9d4d2c1cbfa60;hpb=b4f12b716e27439b7811d748c8faa0cc9480bd2c;p=dygraphs.git
diff --git a/tests/linear-regression-addseries.html b/tests/linear-regression-addseries.html
index 3fd3a85..f44df53 100644
--- a/tests/linear-regression-addseries.html
+++ b/tests/linear-regression-addseries.html
@@ -1,13 +1,17 @@
+
+
Linear Regression
-
-
-
-
+
+
+
@@ -84,6 +88,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 = [];
@@ -96,11 +104,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