X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=plugins%2Fannotations.js;h=6a248949351ebcac23f6e7cbf2064d5c02379a70;hb=de9a8181064aa767e1c70c31a0027a0324cc33c6;hp=7be79661a9dad144c8a4bb2fe4002b114513f74c;hpb=d38c6191118e78792fa7f18bcc5eb3d8de74b610;p=dygraphs.git diff --git a/plugins/annotations.js b/plugins/annotations.js index 7be7966..6a24894 100644 --- a/plugins/annotations.js +++ b/plugins/annotations.js @@ -4,8 +4,12 @@ * MIT-licensed (http://opensource.org/licenses/MIT) */ +/*global Dygraph:false */ + Dygraph.Plugins.Annotations = (function() { +"use strict"; + /** Current bits of jankiness: - Uses dygraph.layout_ to get the parsed annotations. @@ -30,7 +34,7 @@ annotations.prototype.toString = function() { annotations.prototype.activate = function(g) { return { clearChart: this.clearChart, - drawChart: this.drawChart + didDrawChart: this.didDrawChart }; }; @@ -47,12 +51,12 @@ annotations.prototype.clearChart = function(e) { this.detachLabels(); }; -annotations.prototype.drawChart = function(e) { +annotations.prototype.didDrawChart = function(e) { var g = e.dygraph; // Early out in the (common) case of zero annotations. var points = g.layout_.annotated_points; - if (!points || points.length == 0) return; + if (!points || points.length === 0) return; var containerDiv = e.canvas.parentNode; var annotationStyle = {