NEZ-1544 fix:average添加后没有数据

This commit is contained in:
zhangyu
2022-02-14 14:51:49 +08:00
parent 79203e325f
commit b603bc8b28
3 changed files with 23 additions and 4 deletions

View File

@@ -811,7 +811,7 @@ export function getMetricTypeValue (queryItem, type) {
const max = copy.sort((x, y) => { return parseFloat(y[1]) - parseFloat(x[1]) })[0][1]
return max
}
case 'avg': {
case 'average': {
copy = copy.map(t => parseFloat(t[1]))
const sum = eval(copy.join('+'))
const avg = sum / copy.length