[Feature Request] Provide option to set color and width for annotation line (#703)
[dygraphs.git] / tests / linear-regression-addseries.html
index 7c7646d..2efffb1 100644 (file)
@@ -1,16 +1,13 @@
 <!DOCTYPE html>
 <html>
   <head>
-    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
+    <link rel="stylesheet" href="../css/dygraph.css">
     <title>Linear Regression</title>
-    <!--[if IE]>
-    <script type="text/javascript" src="../excanvas.js"></script>
-    <![endif]-->
     <!--
     For production (minified) code, use:
     <script type="text/javascript" src="dygraph-combined.js"></script>
     -->
-    <script type="text/javascript" src="../dygraph-dev.js"></script>
+    <script type="text/javascript" src="../dist/dygraph.js"></script>
 
     <style type="text/css">
     body { max-width: 640 px; }
         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 = [];
             // 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