Graph panel: rename X axis modes, issue #5812.

This commit is contained in:
Alexander Zobnin 2016-08-18 15:34:32 +03:00
parent 93515d0ffc
commit 284a6ee629
3 changed files with 12 additions and 12 deletions

View File

@ -230,9 +230,9 @@ function (angular, $, moment, _, kbn, GraphTooltip) {
var series = data[i]; var series = data[i];
series.data = series.getFlotPairs(series.nullPointMode || panel.nullPointMode); series.data = series.getFlotPairs(series.nullPointMode || panel.nullPointMode);
if (panel.xaxis.mode === 'histogram') { if (panel.xaxis.mode === 'series') {
series.data = [ series.data = [
[i + 1, series.stats[panel.xaxis.histogramValue]] [i + 1, series.stats[panel.xaxis.seriesValue]]
]; ];
} }
@ -243,7 +243,7 @@ function (angular, $, moment, _, kbn, GraphTooltip) {
} }
} }
if (panel.xaxis.mode === 'histogram') { if (panel.xaxis.mode === 'series') {
if (data.length) { if (data.length) {
options.series.bars.barWidth = 0.7; options.series.bars.barWidth = 0.7;
options.series.bars.align = 'center'; options.series.bars.align = 'center';

View File

@ -21,7 +21,7 @@ class GraphCtrl extends MetricsPanelCtrl {
logScales: any; logScales: any;
unitFormats: any; unitFormats: any;
xAxisModes: any; xAxisModes: any;
xAxisHistogramValues: any; xAxisSeriesValues: any;
annotationsPromise: any; annotationsPromise: any;
datapointsCount: number; datapointsCount: number;
datapointsOutside: boolean; datapointsOutside: boolean;
@ -53,8 +53,8 @@ class GraphCtrl extends MetricsPanelCtrl {
], ],
xaxis: { xaxis: {
show: true, show: true,
mode: 'timeseries', mode: 'time',
histogramValue: 'avg' seriesValue: 'avg'
}, },
grid : { grid : {
threshold1: null, threshold1: null,
@ -145,11 +145,11 @@ class GraphCtrl extends MetricsPanelCtrl {
this.unitFormats = kbn.getUnitFormats(); this.unitFormats = kbn.getUnitFormats();
this.xAxisModes = { this.xAxisModes = {
'Time Series': 'timeseries', 'Time': 'time',
'Histogram': 'histogram' 'Series': 'series'
}; };
this.xAxisHistogramValues = ['min', 'max', 'avg', 'current', 'total']; this.xAxisSeriesValues = ['min', 'max', 'avg', 'current', 'total'];
} }
onInitPanelActions(actions) { onInitPanelActions(actions) {

View File

@ -51,12 +51,12 @@
</select> </select>
</div> </div>
</div> </div>
<div class="gf-form" ng-if="ctrl.panel.xaxis.mode==='histogram'"> <div class="gf-form" ng-if="ctrl.panel.xaxis.mode==='series'">
<label class="gf-form-label width-5">Value</label> <label class="gf-form-label width-5">Value</label>
<div class="gf-form-select-wrapper max-width-15"> <div class="gf-form-select-wrapper max-width-15">
<select class="gf-form-input" <select class="gf-form-input"
ng-model="ctrl.panel.xaxis.histogramValue" ng-model="ctrl.panel.xaxis.seriesValue"
ng-options="v for v in ctrl.xAxisHistogramValues" ng-options="v for v in ctrl.xAxisSeriesValues"
ng-change="ctrl.render()"> ng-change="ctrl.render()">
</select> </select>
</div> </div>