Parcourir la source

heatmap: fix error with null values in ES converter (#7999)

Alexander Zobnin il y a 8 ans
Parent
commit
ecd404335e
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  1. 6 1
      public/app/plugins/panel/heatmap/heatmap_data_converter.ts

+ 6 - 1
public/app/plugins/panel/heatmap/heatmap_data_converter.ts

@@ -30,7 +30,12 @@ function convertEsSeriesToHeatmap(series: TimeSeries, saveZeroCounts = false) {
   _.forEach(series.datapoints, point => {
     let bound = series.alias;
     let count = point[VALUE_INDEX];
-    let values = new Array(count);
+
+    if (!count) {
+      return;
+    }
+
+    let values = new Array(Math.round(count));
     values.fill(Number(bound));
 
     let valueBuckets = {};