Commit 15882953 by ilgizar

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

parent 230f018c
...@@ -31,9 +31,14 @@ ...@@ -31,9 +31,14 @@
</div> </div>
</div> </div>
<div class="gf-form" ng-show="$index === 1"> <div class="gf-form-inline" ng-show="$index === 1">
<label class="gf-form-label width-6">Y-Align</label> <div class="gf-form">
<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> <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>
<div ng-if="yaxis.show"> <div ng-if="yaxis.show">
......
...@@ -158,8 +158,9 @@ function graphDirective(timeSrv, popoverSrv, contextSrv) { ...@@ -158,8 +158,9 @@ function graphDirective(timeSrv, popoverSrv, contextSrv) {
function processRangeHook(plot) { function processRangeHook(plot) {
var yaxis = plot.getYAxes(); var yaxis = plot.getYAxes();
if (yaxis.length > 1 && 'align' in panel.yaxes[1] && panel.yaxes[1].align !== null) { if (yaxis.length > 1 && panel.yaxes[1].alignment) {
alignYLevel(yaxis, parseFloat(panel.yaxes[1].align)); var align = panel.yaxes[1].align || 0;
alignYLevel(yaxis, parseFloat(align));
} }
} }
......
...@@ -46,7 +46,8 @@ class GraphCtrl extends MetricsPanelCtrl { ...@@ -46,7 +46,8 @@ class GraphCtrl extends MetricsPanelCtrl {
min: null, min: null,
max: null, max: null,
format: 'short', format: 'short',
align: null, alignment: false,
align: 0,
}, },
], ],
xaxis: { 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