Skip to content

Commit

Permalink
Merge pull request #742 from yamakatu/master
Browse files Browse the repository at this point in the history
Fix for #741. add no zero filling option to histogram
  • Loading branch information
Rashid Khan committed Dec 11, 2013
2 parents 4384772 + 43b844f commit e58e917
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/app/panels/histogram/timeSeries.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ function (_, Interval) {
strategy = this._getAllFlotPairs;
} else if(this.opts.fill_style === 'null') {
strategy = this._getNullFlotPairs;
} else if(this.opts.fill_style === 'no') {
strategy = this._getNoZeroFlotPairs;
} else {
strategy = this._getMinFlotPairs;
}
Expand Down Expand Up @@ -211,6 +213,21 @@ function (_, Interval) {
return result;
};

/**
* ** called as a reduce stragegy in getFlotPairs() **
* Not fill zero's on either side of the current time, only the current time
* @return {array} An array of points to plot with flot
*/
ts.ZeroFilled.prototype._getNoZeroFlotPairs = function (result, time, i, times) {
var next, expected_next, prev, expected_prev;

// add the current time
if(this._data[time]){
result.push([ time, this._data[time]]);
}

return result;
};

return ts;
});

0 comments on commit e58e917

Please sign in to comment.