diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-10-06 15:30:09 -0500 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-10-06 15:30:09 -0500 |
commit | ece9621b1304c7ebc338a6765c7e9aed5126edaa (patch) | |
tree | 7a3bea0193ec1c5271c1b88fbabceadfe79845e2 /app/assets/javascripts/monitoring | |
parent | e3fe48b85dc07b135180f8ec54db95537f794fdc (diff) | |
download | gitlab-ce-ece9621b1304c7ebc338a6765c7e9aed5126edaa.tar.gz |
allow legend to properly handle NaN values
Diffstat (limited to 'app/assets/javascripts/monitoring')
-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) { |