diff --git a/public/app/plugins/panel/heatmap/axes_editor.ts b/public/app/plugins/panel/heatmap/axes_editor.ts index 05ed63e0289..81df957e2ea 100644 --- a/public/app/plugins/panel/heatmap/axes_editor.ts +++ b/public/app/plugins/panel/heatmap/axes_editor.ts @@ -6,6 +6,7 @@ export class AxesEditorCtrl { unitFormats: any; logScales: any; dataFormats: any; + yBucketBoundModes: any; /** @ngInject */ constructor($scope, uiSegmentSrv) { @@ -26,6 +27,12 @@ export class AxesEditorCtrl { 'Time series': 'timeseries', 'Time series buckets': 'tsbuckets', }; + + this.yBucketBoundModes = { + Auto: 'auto', + Upper: 'upper', + Lower: 'lower', + }; } setUnitFormat(subItem) { diff --git a/public/app/plugins/panel/heatmap/heatmap_ctrl.ts b/public/app/plugins/panel/heatmap/heatmap_ctrl.ts index 47d3e6616b9..11fbad47b99 100644 --- a/public/app/plugins/panel/heatmap/heatmap_ctrl.ts +++ b/public/app/plugins/panel/heatmap/heatmap_ctrl.ts @@ -33,6 +33,7 @@ let panelDefaults = { show: false, }, dataFormat: 'timeseries', + yBucketBound: 'auto', xAxis: { show: true, }, @@ -222,11 +223,13 @@ export class HeatmapCtrl extends MetricsPanelCtrl { bucketsData = histogramToHeatmap(this.series); tsBuckets = _.map(this.series, 'label'); - if (panelDatasource === 'prometheus') { + const yBucketBound = this.panel.yBucketBound; + if ((panelDatasource === 'prometheus' && yBucketBound !== 'lower') || yBucketBound === 'upper') { // Prometheus labels are upper inclusive bounds, so add empty bottom bucket label. tsBuckets = [''].concat(tsBuckets); } else { - // Elasticsearch uses labels as bottom bucket bounds, so add empty top bucket label. + // Elasticsearch uses labels as lower bucket bounds, so add empty top bucket label. + // Use this as a default mode as well. tsBuckets.push(''); } diff --git a/public/app/plugins/panel/heatmap/partials/axes_editor.html b/public/app/plugins/panel/heatmap/partials/axes_editor.html index d97bb0361d0..65a5ab18080 100644 --- a/public/app/plugins/panel/heatmap/partials/axes_editor.html +++ b/public/app/plugins/panel/heatmap/partials/axes_editor.html @@ -31,6 +31,15 @@ bs-tooltip="'Override automatic decimal precision for axis.'" ng-model="ctrl.panel.yAxis.decimals" ng-change="ctrl.render()" ng-model-onblur> +
+ +
+ +
+