diff --git a/public/app/plugins/panel/heatmap/heatmap_data_converter.ts b/public/app/plugins/panel/heatmap/heatmap_data_converter.ts index d9e6bbb7d43..ef405ea5508 100644 --- a/public/app/plugins/panel/heatmap/heatmap_data_converter.ts +++ b/public/app/plugins/panel/heatmap/heatmap_data_converter.ts @@ -214,12 +214,14 @@ function pushToYBuckets(buckets, bucketNum, value, point, bounds) { } if (buckets[bucketNum]) { buckets[bucketNum].values.push(value); + buckets[bucketNum].points.push(point); buckets[bucketNum].count += count; } else { buckets[bucketNum] = { y: bucketNum, bounds: bounds, values: [value], + points: [point], count: count, }; } diff --git a/public/app/plugins/panel/heatmap/heatmap_tooltip.ts b/public/app/plugins/panel/heatmap/heatmap_tooltip.ts index 5ec0a8fa308..0d3f65cbf4d 100644 --- a/public/app/plugins/panel/heatmap/heatmap_tooltip.ts +++ b/public/app/plugins/panel/heatmap/heatmap_tooltip.ts @@ -83,7 +83,10 @@ export class HeatmapTooltip { let boundBottom, boundTop, valuesNumber; let xData = data.buckets[xBucketIndex]; - let yData = xData.buckets[yBucketIndex]; + // Search in special 'zero' bucket also + let yData = _.find(xData.buckets, (bucket, bucketIndex) => { + return bucket.bounds.bottom === yBucketIndex || bucketIndex === yBucketIndex; + }); let tooltipTimeFormat = 'YYYY-MM-DD HH:mm:ss'; let time = this.dashboard.formatDate(xData.x, tooltipTimeFormat); @@ -105,7 +108,9 @@ export class HeatmapTooltip { if (yData) { if (yData.bounds) { - boundBottom = valueFormatter(yData.bounds.bottom); + // Display 0 if bucket is a special 'zero' bucket + let bottom = yData.y ? yData.bounds.bottom : 0; + boundBottom = valueFormatter(bottom); boundTop = valueFormatter(yData.bounds.top); valuesNumber = yData.count; tooltipHtml += `