Apply alias functions.

This commit is contained in:
Alexander Zobnin
2016-01-28 20:53:50 +03:00
parent 8a013b5d81
commit 8278ad67cb
3 changed files with 15 additions and 3 deletions

View File

@@ -106,6 +106,11 @@ function (angular, _, moment, utils) {
return _.max(values);
};
this.setAlias = function(alias, timeseries) {
timeseries.target = alias;
return timeseries;
};
this.aggregationFunctions = {
avg: this.AVERAGE,
min: this.MIN,
@@ -127,6 +132,7 @@ function (angular, _, moment, utils) {
average: _.partial(this.aggregateWrapper, this.AVERAGE),
min: _.partial(this.aggregateWrapper, this.MIN),
max: _.partial(this.aggregateWrapper, this.MAX),
setAlias: this.setAlias,
};
});