X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph-layout.js;h=b99896b6343ab63418b3e2785cf957de985ee337;hb=421427956b54e7c1bea26f6865eaf007d406a2d2;hp=b81a12cab844bd28639cb12e7837713d5949dc58;hpb=8e19509a9e0a607dcd2e5b0c3bcbe0e39e3170c2;p=dygraphs.git diff --git a/dygraph-layout.js b/dygraph-layout.js index b81a12c..b99896b 100644 --- a/dygraph-layout.js +++ b/dygraph-layout.js @@ -53,12 +53,13 @@ DygraphLayout.prototype.addDataset = function(setname, set_xy) { }; DygraphLayout.prototype.getPlotArea = function() { - return this.computePlotArea_(); + return this.area_; }; // Compute the box which the chart should be drawn in. This is the canvas's // box, less space needed for axis and chart labels. -DygraphLayout.prototype.computePlotArea_ = function() { +// NOTE: This should only be called by Dygraph.predraw_(). +DygraphLayout.prototype.computePlotArea = function() { var area = { // TODO(danvk): per-axis setting. x: 0, @@ -119,12 +120,7 @@ DygraphLayout.prototype.computePlotArea_ = function() { }; this.dygraph_.cascadeEvents_('layout', e); - // Add space for range selector, if needed. - if (this.attr_('showRangeSelector')) { - area.h -= this.attr_('rangeSelectorHeight') + 4; - } - - return area; + this.area_ = area; }; DygraphLayout.prototype.setAnnotations = function(ann) {