Fix bucket size calculation if all values are 0;

This commit is contained in:
Alexander Zobnin 2017-03-24 15:26:27 +03:00
parent 96e91b5a0f
commit 0023657701

View File

@ -158,7 +158,11 @@ export class HeatmapCtrl extends MetricsPanelCtrl {
yBucketSize = this.panel.yAxis.splitFactor;
} else {
if (heatmapStats.max === heatmapStats.min) {
yBucketSize = heatmapStats.max / Y_BUCKET_NUMBER_DEFAULT;
if (heatmapStats.max) {
yBucketSize = heatmapStats.max / Y_BUCKET_NUMBER_DEFAULT;
} else {
yBucketSize = 1;
}
} else {
yBucketSize = (heatmapStats.max - heatmapStats.min) / yBucketNumber;
}