From: Dan Vanderkam Date: Wed, 29 Sep 2010 15:55:35 +0000 (+0200) Subject: Merge branch 'master' into per_series X-Git-Tag: v1.0.0~648 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=230b34614d5f8e1395e1b142789a40a772642799;hp=-c;p=dygraphs.git Merge branch 'master' into per_series --- 230b34614d5f8e1395e1b142789a40a772642799 diff --combined dygraph.js index 7dab8c7,edc3eea..517f0c6 --- a/dygraph.js +++ b/dygraph.js @@@ -240,12 -240,8 +240,12 @@@ Dygraph.prototype.__init__ = function(d this.start_(); }; -Dygraph.prototype.attr_ = function(name) { - if (typeof(this.user_attrs_[name]) != 'undefined') { +Dygraph.prototype.attr_ = function(name, series) { + if (series && + typeof(this.user_attrs_[series]) != 'undefined' && + typeof(this.user_attrs_[series][name]) != 'undefined') { + return this.user_attrs_[series][name]; + } else if (typeof(this.user_attrs_[name]) != 'undefined') { return this.user_attrs_[name]; } else if (typeof(this.attrs_[name]) != 'undefined') { return this.attrs_[name]; @@@ -1041,7 -1037,7 +1041,7 @@@ Dygraph.prototype.updateSelection_ = fu if (this.attr_('showLabelsOnHighlight')) { // Set the status message to indicate the selected point(s) for (var i = 0; i < this.selPoints_.length; i++) { - if (!this.attr_("labelsShowZeroValues") && this.selPoints_[i].yval == 0) continue; + if (!this.attr_("labelsShowZeroValues") && this.selPoints_[i].yval == 0) continue; if (!isOK(this.selPoints_[i].canvasy)) continue; if (this.attr_("labelsSeparateLines")) { replace += "
"; @@@ -1585,6 -1581,8 +1585,6 @@@ Dygraph.prototype.drawGraph_ = function this.setColors_(); this.attrs_['pointSize'] = 0.5 * this.attr_('highlightCircleSize'); - var connectSeparatedPoints = this.attr_('connectSeparatedPoints'); - // Loop over the fields (series). Go from the last to the first, // because if they're stacked that's how we accumulate the values. @@@ -1595,8 -1593,6 +1595,8 @@@ for (var i = data[0].length - 1; i >= 1; i--) { if (!this.visibility()[i - 1]) continue; + var connectSeparatedPoints = this.attr_('connectSeparatedPoints', i); + var series = []; for (var j = 0; j < data.length; j++) { if (data[j][i] != null || !connectSeparatedPoints) { @@@ -2152,8 -2148,8 +2152,8 @@@ Dygraph.prototype.parseDataTable_ = fun var row = []; if (typeof(data.getValue(i, 0)) === 'undefined' || data.getValue(i, 0) === null) { - this.warning("Ignoring row " + i + - " of DataTable because of undefined or null first column."); + this.warn("Ignoring row " + i + + " of DataTable because of undefined or null first column."); continue; } @@@ -2310,9 -2306,6 +2310,9 @@@ Dygraph.prototype.updateOptions = funct if (attrs.valueRange) { this.valueRange_ = attrs.valueRange; } + + // TODO(danvk): validate per-series options. + Dygraph.update(this.user_attrs_, attrs); Dygraph.update(this.renderOptions_, attrs);