X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph-layout.js;h=b99896b6343ab63418b3e2785cf957de985ee337;hb=421427956b54e7c1bea26f6865eaf007d406a2d2;hp=900db689fdec59259281e2f847d37d2312f6dbec;hpb=7c5c5ece906e40e036e401ab92296c18f5c32f3a;p=dygraphs.git diff --git a/dygraph-layout.js b/dygraph-layout.js index 900db68..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) { @@ -233,7 +229,7 @@ DygraphLayout.prototype._evaluateLineCharts = function() { var setName = this.setNames[setIdx]; var axis = this.dygraph_.axisPropertiesForSeries(setName); // TODO (konigsberg): use optionsForAxis instead. - var logscale = this.dygraph_.attributes_.getForSeries("logscale", setIdx); + var logscale = this.dygraph_.attributes_.getForSeries("logscale", setName); // Preallocating the size of points reduces reallocations, and therefore, // calls to collect garbage. @@ -325,7 +321,7 @@ DygraphLayout.prototype.evaluateWithError = function() { var setName = this.setNames[setIdx]; var axis = this.dygraph_.axisPropertiesForSeries(setName); // TODO (konigsberg): use optionsForAxis instead. - var logscale = this.dygraph_.attributes_.getForSeries("logscale", setIdx); + var logscale = this.dygraph_.attributes_.getForSeries("logscale", setName); for (j = 0; j < dataset.length; j++, i++) { var item = dataset[j];