s/RGBColor/RGBColorParser in the tests directory.
[dygraphs.git] / dygraph-layout.js
index 900db68..b99896b 100644 (file)
@@ -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];