From 578ee88ff37a339bdc63ca9a524ce00ce46d86f3 Mon Sep 17 00:00:00 2001 From: ilgizar Date: Thu, 8 Feb 2018 12:53:02 +0500 Subject: [PATCH 1/4] Fix #7107 --- .../plugins/panel/graph/threshold_manager.ts | 30 ++++++++++++++----- .../plugins/panel/graph/thresholds_form.ts | 10 +++++++ 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/public/app/plugins/panel/graph/threshold_manager.ts b/public/app/plugins/panel/graph/threshold_manager.ts index b5159d823f8..6d781543bda 100644 --- a/public/app/plugins/panel/graph/threshold_manager.ts +++ b/public/app/plugins/panel/graph/threshold_manager.ts @@ -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, + }); + } } } } diff --git a/public/app/plugins/panel/graph/thresholds_form.ts b/public/app/plugins/panel/graph/thresholds_form.ts index 48b2112e4bc..a6e821184e9 100644 --- a/public/app/plugins/panel/graph/thresholds_form.ts +++ b/public/app/plugins/panel/graph/thresholds_form.ts @@ -29,6 +29,7 @@ export class ThresholdFormCtrl { op: 'gt', fill: true, line: true, + yaxis: 'left', }); this.panelCtrl.render(); } @@ -109,6 +110,15 @@ var template = ` +
+ +
+ +
+
+