From e44acff11cf717ea31da19ec4ae7f18f99dcfb3a Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Thu, 23 Jul 2020 11:00:19 -0700 Subject: [PATCH] Graph: support setting field units (#26529) (cherry picked from commit ad5f1c953b7ec08f139a3e53f30ceb358850b777) --- public/app/plugins/panel/graph/axes_editor.html | 5 ++++- public/app/plugins/panel/graph/module.ts | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/panel/graph/axes_editor.html b/public/app/plugins/panel/graph/axes_editor.html index 5dba3d0a87f..fe2541eb627 100644 --- a/public/app/plugins/panel/graph/axes_editor.html +++ b/public/app/plugins/panel/graph/axes_editor.html @@ -13,7 +13,10 @@
- +
diff --git a/public/app/plugins/panel/graph/module.ts b/public/app/plugins/panel/graph/module.ts index 53d5fa5873a..ccd60756da0 100644 --- a/public/app/plugins/panel/graph/module.ts +++ b/public/app/plugins/panel/graph/module.ts @@ -306,6 +306,7 @@ export class GraphCtrl extends MetricsPanelCtrl { for (const series of this.seriesList) { series.applySeriesOverrides(this.panel.seriesOverrides); + // Always use the configured field unit if (series.unit) { this.panel.yaxes[series.yaxis - 1].format = series.unit; } @@ -379,6 +380,7 @@ export const plugin = new PanelPlugin(null) .useFieldConfig({ standardOptions: [ FieldConfigProperty.DisplayName, + FieldConfigProperty.Unit, FieldConfigProperty.Links, // previously saved as dataLinks on options ], })