Commit 578ee88f by ilgizar

Fix #7107

parent 39238c19
......@@ -222,16 +222,30 @@ export class ThresholdManager {
// fill
if (threshold.fill) {
options.grid.markings.push({
yaxis: { from: threshold.value, to: limit },
color: fillColor,
});
if (threshold.yaxis === 'right' && this.shouldDrawHandles) {
options.grid.markings.push({
y2axis: { from: threshold.value, to: limit },
color: fillColor,
});
} else {
options.grid.markings.push({
yaxis: { from: threshold.value, to: limit },
color: fillColor,
});
}
}
if (threshold.line) {
options.grid.markings.push({
yaxis: { from: threshold.value, to: threshold.value },
color: lineColor,
});
if (threshold.yaxis === 'right' && this.shouldDrawHandles) {
options.grid.markings.push({
y2axis: { from: threshold.value, to: threshold.value },
color: lineColor,
});
} else {
options.grid.markings.push({
yaxis: { from: threshold.value, to: threshold.value },
color: lineColor,
});
}
}
}
}
......
......@@ -29,6 +29,7 @@ export class ThresholdFormCtrl {
op: 'gt',
fill: true,
line: true,
yaxis: 'left',
});
this.panelCtrl.render();
}
......@@ -110,6 +111,15 @@ var template = `
</div>
<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">
<a class="pointer" ng-click="ctrl.removeThreshold($index)" ng-disabled="ctrl.disabled">
<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