Commit 0e159dad by ilgizar

Allocated to a separate alignment block. Replaced the attribute of the second…

Allocated to a separate alignment block. Replaced the attribute of the second axis by the attribute of the axes.
parent e015047e
......@@ -31,16 +31,6 @@
</div>
</div>
<div class="gf-form-inline" ng-show="$index === 1">
<div class="gf-form">
<gf-form-switch class="gf-form" label="Align" tooltip="Align two Y-axes by {{yaxis.alignment ? yaxis.align || 0 : 'value'}}" label-class="width-6" switch-class="width-5" checked="yaxis.alignment" on-change="ctrl.render()"></gf-form-switch>
</div>
<div class="gf-form" ng-show="yaxis.alignment">
<label class="gf-form-label width-6">Value</label>
<input type="number" class="gf-form-input width-5" placeholder="0" ng-model="yaxis.align" ng-change="ctrl.render()" ng-model-onblur ng-init="yaxis.align = yaxis.align || 0">
</div>
</div>
<div ng-if="yaxis.show">
<div class="gf-form">
<label class="gf-form-label width-6">Decimals</label>
......@@ -77,6 +67,16 @@
<input type="number" class="gf-form-input max-width-8" ng-model="ctrl.panel.xaxis.buckets" placeholder="auto" ng-change="ctrl.render()" ng-model-onblur bs-tooltip="'Number of buckets'" data-placement="right">
</div>
<div>
<br/>
<h5 class="section-heading">Y-Axes</h5>
<gf-form-switch class="gf-form" label="Align" tooltip="Align two Y-axes by {{ctrl.panel.yaxis.alignment ? ctrl.panel.yaxis.align || 0 : 'value'}}" label-class="width-6" switch-class="width-5" checked="ctrl.panel.yaxis.alignment" on-change="ctrl.render()"></gf-form-switch>
<div class="gf-form" ng-show="ctrl.panel.yaxis.alignment">
<label class="gf-form-label width-6">Value</label>
<input type="number" class="gf-form-input width-5" placeholder="0" ng-model="ctrl.panel.yaxis.align" ng-change="ctrl.render()" ng-model-onblur ng-init="ctrl.panel.yaxis.align = ctrl.panel.yaxis.align || 0">
</div>
</div>
</div>
</div>
......@@ -158,8 +158,8 @@ function graphDirective(timeSrv, popoverSrv, contextSrv) {
function processRangeHook(plot) {
var yaxis = plot.getYAxes();
if (yaxis.length > 1 && panel.yaxes[1].alignment) {
var align = panel.yaxes[1].align || 0;
if (yaxis.length > 1 && panel.yaxis.alignment) {
var align = panel.yaxis.align || 0;
alignYLevel(yaxis, parseFloat(align));
}
}
......
......@@ -46,8 +46,6 @@ class GraphCtrl extends MetricsPanelCtrl {
min: null,
max: null,
format: 'short',
alignment: false,
align: 0,
},
],
xaxis: {
......@@ -57,6 +55,10 @@ class GraphCtrl extends MetricsPanelCtrl {
values: [],
buckets: null,
},
yaxis: {
alignment: false,
align: 0,
},
// show/hide lines
lines: true,
// fill factor
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment