Graph: Fix setting right y-axis when standard option unit is configured (#32426) (#32442)

(cherry picked from commit 33e33e3872)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
This commit is contained in:
Grot (@grafanabot)
2021-03-30 11:27:04 +02:00
committed by GitHub
co-authored by Torkel Ödegaard
parent 270660eaa8
commit 8262548005
@@ -51,9 +51,9 @@ export class AxesEditorCtrl {
setUnitFormat(axis: { format: any }) {
return (unit: string) => {
axis.format = unit;
// if already set via field config we need to update that as well
// if already set via field config we clear that
if (this.panel.fieldConfig.defaults.unit) {
this.panel.fieldConfig.defaults.unit = unit;
this.panel.fieldConfig.defaults.unit = undefined;
this.panelCtrl.refresh();
} else {
this.panelCtrl.render();