X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=plugins%2Fchart-labels.js;h=d6c10951d7cf6226f07a4a482def4583c8b257ca;hb=0a14b0f9fbe3e97e0163b4e6ad7893e49d3bf2ff;hp=5e544dcf154b81282fb0d10181fbbe8987962897;hpb=60c695cc8a5455f37cc996e0cef14e775865dfbe;p=dygraphs.git diff --git a/plugins/chart-labels.js b/plugins/chart-labels.js index 5e544dc..d6c1095 100644 --- a/plugins/chart-labels.js +++ b/plugins/chart-labels.js @@ -5,6 +5,8 @@ */ Dygraph.Plugins.ChartLabels = (function() { +"use strict"; + // TODO(danvk): move chart label options out of dygraphs and into the plugin. // TODO(danvk): only tear down & rebuild the DIVs when it's necessary. @@ -23,7 +25,7 @@ chart_labels.prototype.activate = function(g) { return { layout: this.layout, // clearChart: this.clearChart, - drawChart: this.drawChart + didDrawChart: this.didDrawChart }; }; @@ -58,7 +60,7 @@ chart_labels.prototype.detachLabels_ = function() { var createRotatedDiv = function(g, box, axis, classes, html) { // TODO(danvk): is this outer div actually necessary? - div = document.createElement("div"); + var div = document.createElement("div"); div.style.position = 'absolute'; if (axis == 1) { // NOTE: this is cheating. Should be positioned relative to the box. @@ -100,7 +102,7 @@ var createRotatedDiv = function(g, box, axis, classes, html) { inner_div.style.top = '0px'; } - class_div = document.createElement("div"); + var class_div = document.createElement("div"); class_div.className = classes; class_div.innerHTML = html; @@ -169,7 +171,7 @@ chart_labels.prototype.layout = function(e) { } }; -chart_labels.prototype.drawChart = function(e) { +chart_labels.prototype.didDrawChart = function(e) { var g = e.dygraph; if (this.title_div_) { this.title_div_.children[0].innerHTML = g.getOption('title');