Commit 15882953 by ilgizar

Changed the way this feature was activated. And changed tolltip.

parent 230f018c
......@@ -31,9 +31,14 @@
</div>
</div>
<div class="gf-form" ng-show="$index === 1">
<label class="gf-form-label width-6">Y-Align</label>
<input type="text" class="gf-form-input width-5" placeholder="none" empty-to-null bs-tooltip="'Align values for two Y-axes'" ng-model="yaxis.align" ng-change="ctrl.render()" ng-model-onblur>
<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">
......
......@@ -158,8 +158,9 @@ function graphDirective(timeSrv, popoverSrv, contextSrv) {
function processRangeHook(plot) {
var yaxis = plot.getYAxes();
if (yaxis.length > 1 && 'align' in panel.yaxes[1] && panel.yaxes[1].align !== null) {
alignYLevel(yaxis, parseFloat(panel.yaxes[1].align));
if (yaxis.length > 1 && panel.yaxes[1].alignment) {
var align = panel.yaxes[1].align || 0;
alignYLevel(yaxis, parseFloat(align));
}
}
......
......@@ -46,7 +46,8 @@ class GraphCtrl extends MetricsPanelCtrl {
min: null,
max: null,
format: 'short',
align: null,
alignment: false,
align: 0,
},
],
xaxis: {
......
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