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];
series.data = series.getFlotPairs(series.nullPointMode || panel.nullPointMode);
if (panel.xaxis.mode === 'histogram') {
if (panel.xaxis.mode === 'series') {
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) {
options.series.bars.barWidth = 0.7;
options.series.bars.align = 'center';

View File

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

View File

@ -51,12 +51,12 @@
</select>
</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>
<div class="gf-form-select-wrapper max-width-15">
<select class="gf-form-input"
ng-model="ctrl.panel.xaxis.histogramValue"
ng-options="v for v in ctrl.xAxisHistogramValues"
ng-model="ctrl.panel.xaxis.seriesValue"
ng-options="v for v in ctrl.xAxisSeriesValues"
ng-change="ctrl.render()">
</select>
</div>