Show last aggregation function as metric alias.

This commit is contained in:
Alexander Zobnin
2016-01-28 19:56:59 +03:00
parent ce757409c3
commit 8a013b5d81

View File

@@ -167,8 +167,12 @@ function (angular, _, dateMath, utils, metricFunctions) {
for (var i = 0; i < aggregationFunctions.length; i++) {
dp = aggregationFunctions[i](dp);
}
var lastAgg = _.findLast(target.functions, function(func) {
return _.contains(
_.map(metricFunctions.getCategories()['Aggregate'], 'name'), func.def.name);
});
timeseries_data = {
target: 'agg',
target: lastAgg.text,
datapoints: dp
};
}