diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-10-06 23:30:09 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-10-06 23:30:09 +0300 |
commit | ece9621b1304c7ebc338a6765c7e9aed5126edaa (patch) | |
tree | 7a3bea0193ec1c5271c1b88fbabceadfe79845e2 /app/assets | |
parent | e3fe48b85dc07b135180f8ec54db95537f794fdc (diff) |
allow legend to properly handle NaN values
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/monitoring/components/graph/legend.vue | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/monitoring/components/graph/legend.vue b/app/assets/javascripts/monitoring/components/graph/legend.vue index dbc48c63747..85b6d7f4cbe 100644 --- a/app/assets/javascripts/monitoring/components/graph/legend.vue +++ b/app/assets/javascripts/monitoring/components/graph/legend.vue @@ -79,7 +79,11 @@ }, formatMetricUsage(series) { - return `${formatRelevantDigits(series.values[this.currentDataIndex].value)} ${this.unitOfDisplay}`; + const value = series.values[this.currentDataIndex].value; + if (isNaN(value)) { + return '-'; + } + return `${formatRelevantDigits(value)} ${this.unitOfDisplay}`; }, createSeriesString(index, series) { |