Fix errors/warnings in tests/*.html
[dygraphs.git] / tests / connect-separated.html
index 306c74b..ef6034d 100644 (file)
@@ -1,15 +1,13 @@
 <!DOCTYPE html>
 <html>
   <head>
-    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
     <title>connect separated</title>
-    <!--[if IE]>
-    <script type="text/javascript" src="../excanvas.js"></script>
-    <![endif]-->
-    <script type="text/javascript" src="../strftime/strftime-min.js"></script>
-    <script type="text/javascript" src="../rgbcolor/rgbcolor.js"></script>
-    <script type="text/javascript" src="../dygraph-canvas.js"></script>
-    <script type="text/javascript" src="../dygraph.js"></script>
+    <!--
+    For production (minified) code, use:
+    <script type="text/javascript" src="dygraph-combined.js"></script>
+    -->
+    <script type="text/javascript" src="../dist/dygraph.js"></script>
+
   </head>
   <body>
     <p>Connecting separated points.  All three of the series should have their points
       overlays in the proper color.</p>
 
     <div id="graphdiv" style="width:600px; height:300px;"></div>
+<p><b>Toggle ConnectSeparated:<b></p>
+<p>
+  All: <button id="All" onclick="change(this)">true</button>
+  Series 1 <button id="Series1" onclick="change(this)">disabled</button>
+  Series 2 <button id="Series2" onclick="change(this)">disabled</button>
+  Series 3 <button id="Series3" onclick="change(this)">disabled</button>
+</p>
     <script type="text/javascript">
-      new Dygraph(document.getElementById("graphdiv"),
+      var g = new Dygraph(document.getElementById("graphdiv"),
       [
         [ new Date("2009/12/01"), 10, 10, 10],
         [ new Date("2009/12/02"), 15, 11, 12],
         connectSeparatedPoints: true,
         labels: ["Date","Series1","Series2","Series3"]
       });
+
+      function change(el) {
+        var textSequences = [ "disabled", "true", "false" ];
+        var values = [ null, true, false ];
+        for (var idx = 0; idx < textSequences.length; idx++) {
+          if (textSequences[idx] == el.textContent) {
+            var nextIdx = (idx + 1) % 3;
+            var nextVal = values[nextIdx];
+            el.textContent = textSequences[nextIdx];
+
+            if (el.id == "All") {
+              g.updateOptions({ connectSeparatedPoints : nextVal });
+            } else {
+              var seriesOpt = {};
+              seriesOpt[el.id] = { connectSeparatedPoints : nextVal };
+              g.updateOptions({ series : seriesOpt });
+            }
+            break;
+          }
+        }
+      }
     </script>
   </body>
 </html>