Merge branch 'master' into per_series
authorDan Vanderkam <danvdk@gmail.com>
Wed, 29 Sep 2010 15:55:35 +0000 (17:55 +0200)
committerDan Vanderkam <danvdk@gmail.com>
Wed, 29 Sep 2010 15:55:35 +0000 (17:55 +0200)
1  2 
dygraph.js

diff --combined 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 += "<br/>";
@@@ -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.
  
    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);