Commit 578ee88f by ilgizar

Fix #7107

parent 39238c19
...@@ -222,12 +222,25 @@ export class ThresholdManager { ...@@ -222,12 +222,25 @@ export class ThresholdManager {
// fill // fill
if (threshold.fill) { if (threshold.fill) {
if (threshold.yaxis === 'right' && this.shouldDrawHandles) {
options.grid.markings.push({
y2axis: { from: threshold.value, to: limit },
color: fillColor,
});
} else {
options.grid.markings.push({ options.grid.markings.push({
yaxis: { from: threshold.value, to: limit }, yaxis: { from: threshold.value, to: limit },
color: fillColor, color: fillColor,
}); });
} }
}
if (threshold.line) { if (threshold.line) {
if (threshold.yaxis === 'right' && this.shouldDrawHandles) {
options.grid.markings.push({
y2axis: { from: threshold.value, to: threshold.value },
color: lineColor,
});
} else {
options.grid.markings.push({ options.grid.markings.push({
yaxis: { from: threshold.value, to: threshold.value }, yaxis: { from: threshold.value, to: threshold.value },
color: lineColor, color: lineColor,
...@@ -235,4 +248,5 @@ export class ThresholdManager { ...@@ -235,4 +248,5 @@ export class ThresholdManager {
} }
} }
} }
}
} }
...@@ -29,6 +29,7 @@ export class ThresholdFormCtrl { ...@@ -29,6 +29,7 @@ export class ThresholdFormCtrl {
op: 'gt', op: 'gt',
fill: true, fill: true,
line: true, line: true,
yaxis: 'left',
}); });
this.panelCtrl.render(); this.panelCtrl.render();
} }
...@@ -110,6 +111,15 @@ var template = ` ...@@ -110,6 +111,15 @@ var template = `
</div> </div>
<div class="gf-form"> <div class="gf-form">
<label class="gf-form-label">Y-axis</label>
<div class="gf-form-select-wrapper">
<select class="gf-form-input" ng-model="threshold.yaxis"
ng-options="f for f in ['left', 'right']" ng-change="ctrl.render()" ng-disabled="ctrl.disabled">
</select>
</div>
</div>
<div class="gf-form">
<label class="gf-form-label"> <label class="gf-form-label">
<a class="pointer" ng-click="ctrl.removeThreshold($index)" ng-disabled="ctrl.disabled"> <a class="pointer" ng-click="ctrl.removeThreshold($index)" ng-disabled="ctrl.disabled">
<i class="fa fa-trash"></i> <i class="fa fa-trash"></i>
......
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