mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 20:54:22 -06:00
Graph panel: rename X axis modes, issue #5812.
This commit is contained in:
parent
93515d0ffc
commit
284a6ee629
@ -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';
|
||||
|
@ -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) {
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user