Преглед на файлове

Fixes null checks for legend value formaters (fix for #97)

Torkel Ödegaard преди 12 години
родител
ревизия
d10bf9f993
променени са 1 файла, в които са добавени 5 реда и са изтрити 5 реда
  1. 5 5
      src/app/panels/graphite/timeSeries.js

+ 5 - 5
src/app/panels/graphite/timeSeries.js

@@ -55,11 +55,11 @@ function (_, kbn) {
       this.info.current = result[result.length-1][1];
 
       var formater = getFormater(yFormats[this.yaxis - 1]);
-      this.info.avg = formater(this.info.avg);
-      this.info.current = formater(this.info.current);
-      this.info.min = formater(this.info.min);
-      this.info.max = formater(this.info.max);
-      this.info.total = formater(this.info.total);
+      this.info.avg = this.info.avg ? formater(this.info.avg) : null;
+      this.info.current = this.info.current ? formater(this.info.current) : null;
+      this.info.min = this.info.min ? formater(this.info.min) : null;
+      this.info.max = this.info.max ? formater(this.info.max) : null;
+      this.info.total = this.info.total ? formater(this.info.total) : null;
     }
 
     return result;