add the magic <meta> tag for IE8+9
[dygraphs.git] / tests / two-axes.html
index bc03abc..0b715f7 100644 (file)
@@ -1,8 +1,10 @@
+<!DOCTYPE html>
 <html>
   <head>
+    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
     <title>Multiple y-axes</title>
     <!--[if IE]>
-    <script type="text/javascript" src="excanvas.js"></script>
+    <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>
   </head>
   <body>
     <h2>Multiple y-axes</h2>
+    <p>The same data with both one and two y-axes. Two y-axes:</p>
     <div id="demodiv"></div>
+    <p>A single y-axis:</p>
+    <div id="demodiv_one"></div>
+
     <script type="text/javascript">
       var data = [];
       for (var i = 1; i <= 100; i++) {
                    1e6 * (1 + i * (100 - i) / (50 * 50)),
                    1e6 * (2 - i * (100 - i) / (50 * 50))]);
       }
+
       g = new Dygraph(
-              document.getElementById("demodiv"),
-              data,
-              {
-                labels: [ 'Date', 'Y1', 'Y2', 'Y3', 'Y4' ],
-                width: 640,
-                height: 350,
-                'Y3': {
-                  axis: {
-                    // set axis-related properties here
-                    labelsKMB: true
-                  }
-                },
-                'Y4': {
-                  axis: 'Y3'  // use the same y-axis as series Y3
-                }
+          document.getElementById("demodiv"),
+          data,
+          {
+            labels: [ 'Date', 'Y1', 'Y2', 'Y3', 'Y4' ],
+            width: 640,
+            height: 350,
+            'Y3': {
+              axis: {
+                // set axis-related properties here
+                labelsKMB: true
               }
-          );
+            },
+            'Y4': {
+              axis: 'Y3'  // use the same y-axis as series Y3
+            }
+          }
+      );
+
+      g2 = new Dygraph(
+          document.getElementById("demodiv_one"),
+          data,
+          {
+            labels: [ 'Date', 'Y1', 'Y2', 'Y3', 'Y4' ],
+            width: 640,
+            height: 350,
+            labelsKMB: true
+          }
+      );
+
+      function update(el) {
+        g.updateOptions( { fillGraph: el.checked } );
+        g2.updateOptions( { fillGraph: el.checked } );
+      }
     </script>
+
+    <input type=checkbox id="check" onChange="update(this)"><label for="check"> Fill?</label>
 </body>
 </html>