X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=sidebyside;f=gallery%2Fannotations.js;h=290f0dbbab5d73dce9afaa3f0e48867ed4054185;hb=660bb307f01c14f7d7d1b839812840fb179481ec;hp=af0c5420309ccd95c094ef561c172a601fb1213c;hpb=e1e80cce232a1efbebc1e3dbe236ecf957464c68;p=dygraphs.git diff --git a/gallery/annotations.js b/gallery/annotations.js index af0c542..290f0db 100644 --- a/gallery/annotations.js +++ b/gallery/annotations.js @@ -1,3 +1,4 @@ +/*global Gallery,Dygraph,data */ Gallery.register( 'annotations', { @@ -19,7 +20,7 @@ Gallery.register( return "(" + ann.series + ", " + ann.x + ")"; } - g = new Dygraph( + var g = new Dygraph( document.getElementById("g_div"), function() { var zp = function(x) { if (x < 10) return "0"+x; else return x; }; @@ -54,7 +55,7 @@ Gallery.register( ); var last_ann = 0; - annotations = []; + var annotations = []; for (var x = 10; x < 15; x += 2) { annotations.push( { series: 'sine wave', @@ -81,7 +82,6 @@ Gallery.register( document.getElementById('add').onclick = function() { var x = last_ann + 2; - var annnotations = g.annotations(); annotations.push( { series: 'line', x: "200610" + x,