};
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,
};
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) {
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.
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];