Merge branch 'master' of https://github.com/kberg/dygraphs
[dygraphs.git] / tests / annotation.html
index 8f6b51d..b95c788 100644 (file)
@@ -1,8 +1,10 @@
+<!DOCTYPE html>
 <html>
   <head>
+    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
     <title>demo</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="dygraph-combined.js"></script>
@@ -22,7 +24,7 @@
     <input type="button" value="Add Annotation" onclick="add()" />
     <input type="button" value="Shove to bottom" onclick="bottom(this)" />
     <div id="events"> </div>
-    <div style="position:absolute; left:200px; top: 200px;" id="g"></div>
+    <div style="position:absolute; left:200px; top: 200px;" id="g_div"></div>
     <div style="position:absolute; left:700px; top: 200px;" id="list"></div>
 
     <script type="text/javascript">
@@ -31,8 +33,8 @@
         return "(" + ann.series + ", " + ann.x + ")";
       }
 
-      g = new DateGraph(
-              document.getElementById("g"),
+      g = new Dygraph(
+              document.getElementById("g_div"),
               function() {
                 var zp = function(x) { if (x < 10) return "0"+x; else return x; };
                 var r = "date,parabola,line,another line,sine wave\n";
                   for (var i = 0; i < ann.length; i++) {
                     var name = nameAnnotation(ann[i]);
                     html += "<span id='" + name + "'>"
-                    html += name + ": " + ann[i].shortText + " -> ";
-                    html += ann[i].text + "</span><br/>";
+                    html += name + ": " + (ann[i].shortText || '(icon)')
+                    html += " -> " + ann[i].text + "</span><br/>";
                   }
                   document.getElementById("list").innerHTML = html;
-                },
+                }
               }
           );
 
@@ -80,8 +82,8 @@
         series: 'another line',
         x: "20061013",
         icon: 'dollar.png',
-        iconWidth: 18,
-        iconHeight: 23,
+        width: 18,
+        height: 23,
         tickHeight: 4,
         text: 'Another one',
         cssClass: 'annotation',