X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=plugins%2Faxes.js;h=1e17ff2829f6826520ea33badcbc6b6adc019150;hb=d3b494307a47a61c2b0495ff36dcead00812213e;hp=e74f289973b8c14f5fc7359c2bfa000a2ab0db40;hpb=600da35ccf7fda98f16ba16037c80451ebca9cf5;p=dygraphs.git diff --git a/plugins/axes.js b/plugins/axes.js index e74f289..1e17ff2 100644 --- a/plugins/axes.js +++ b/plugins/axes.js @@ -4,6 +4,8 @@ * MIT-licensed (http://opensource.org/licenses/MIT) */ +/*global Dygraph:false */ + Dygraph.Plugins.Axes = (function() { "use strict"; @@ -52,7 +54,7 @@ axes.prototype.layout = function(e) { if (g.getOption('drawYAxis')) { var w = g.getOption('yAxisLabelWidth') + 2 * g.getOption('axisTickSize'); - var y_axis_rect = e.reserveSpaceLeft(w); + e.reserveSpaceLeft(w); } if (g.getOption('drawXAxis')) { @@ -65,13 +67,13 @@ axes.prototype.layout = function(e) { } else { h = g.getOptionForAxis('axisLabelFontSize', 'x') + 2 * g.getOption('axisTickSize'); } - var x_axis_rect = e.reserveSpaceBottom(h); + e.reserveSpaceBottom(h); } if (g.numAxes() == 2) { // TODO(danvk): per-axis setting. var w = g.getOption('yAxisLabelWidth') + 2 * g.getOption('axisTickSize'); - var y2_axis_rect = e.reserveSpaceRight(w); + e.reserveSpaceRight(w); } else if (g.numAxes() > 2) { g.error("Only two y-axes are supported at this time. (Trying " + "to use " + g.numAxes() + ")"); @@ -93,7 +95,6 @@ axes.prototype.detachLabels = function() { }; axes.prototype.clearChart = function(e) { - var g = e.dygraph; this.detachLabels(); }; @@ -123,12 +124,12 @@ axes.prototype.willDrawChart = function(e) { lineHeight: "normal", // Something other than "normal" line-height screws up label positioning. overflow: "hidden" }; - } + }; var labelStyles = { x : makeLabelStyle('x'), y : makeLabelStyle('y'), - y2 : makeLabelStyle('y2'), + y2 : makeLabelStyle('y2') }; var makeDiv = function(txt, axis, prec_axis) {