|
@@ -101,10 +101,9 @@ function (_, Interval) {
|
|
|
strategy = this._getAllFlotPairs;
|
|
strategy = this._getAllFlotPairs;
|
|
|
} else if(this.opts.fill_style === 'null') {
|
|
} else if(this.opts.fill_style === 'null') {
|
|
|
strategy = this._getNullFlotPairs;
|
|
strategy = this._getNullFlotPairs;
|
|
|
- } else if (this.opts.fill_style === 'connect') {
|
|
|
|
|
- strategy = this._getFlotPairsConnect;
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
|
|
+ } else if(this.opts.fill_style === 'no') {
|
|
|
|
|
+ strategy = this._getNoZeroFlotPairs;
|
|
|
|
|
+ } else {
|
|
|
strategy = this._getMinFlotPairs;
|
|
strategy = this._getMinFlotPairs;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -115,12 +114,19 @@ function (_, Interval) {
|
|
|
this // context
|
|
this // context
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- return pairs;
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ // if the first or last pair is inside either the start or end time,
|
|
|
|
|
+ // add those times to the series with null values so the graph will stretch to contain them.
|
|
|
|
|
+ // Removing, flot 0.8.1's max/min params satisfy this
|
|
|
|
|
+ /*
|
|
|
|
|
+ if (this.start_time && (pairs.length === 0 || pairs[0][0] > this.start_time)) {
|
|
|
|
|
+ pairs.unshift([this.start_time, null]);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.end_time && (pairs.length === 0 || pairs[pairs.length - 1][0] < this.end_time)) {
|
|
|
|
|
+ pairs.push([this.end_time, null]);
|
|
|
|
|
+ }
|
|
|
|
|
+ */
|
|
|
|
|
|
|
|
- ts.ZeroFilled.prototype._getFlotPairsConnect = function (result, time, i, times) {
|
|
|
|
|
- result.push([times[i], this._data[times[i]] || 0 ]);
|
|
|
|
|
- return result;
|
|
|
|
|
|
|
+ return pairs;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -164,6 +170,7 @@ function (_, Interval) {
|
|
|
*/
|
|
*/
|
|
|
ts.ZeroFilled.prototype._getAllFlotPairs = function (result, time, i, times) {
|
|
ts.ZeroFilled.prototype._getAllFlotPairs = function (result, time, i, times) {
|
|
|
var next, expected_next;
|
|
var next, expected_next;
|
|
|
|
|
+
|
|
|
result.push([ times[i], this._data[times[i]] || 0 ]);
|
|
result.push([ times[i], this._data[times[i]] || 0 ]);
|
|
|
next = times[i + 1];
|
|
next = times[i + 1];
|
|
|
expected_next = this.interval.after(time);
|
|
expected_next = this.interval.after(time);
|
|
@@ -206,6 +213,20 @@ function (_, Interval) {
|
|
|
return result;
|
|
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) {
|
|
|
|
|
+
|
|
|
|
|
+ // add the current time
|
|
|
|
|
+ if(this._data[time]){
|
|
|
|
|
+ result.push([ time, this._data[time]]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return result;
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
return ts;
|
|
return ts;
|
|
|
});
|
|
});
|