Various Panels: Add ability to toggle legend with keyboard shortcut (#52241)

This commit is contained in:
Alyssa Bull
2022-07-27 13:39:55 -06:00
committed by GitHub
parent d06ea6ea0e
commit 6ec9a7682d
30 changed files with 192 additions and 72 deletions

View File

@ -1,5 +1,4 @@
import { FieldColorModeId, FieldConfigProperty, PanelPlugin } from '@grafana/data';
import { LegendDisplayMode } from '@grafana/schema';
import { commonOptionsBuilder } from '@grafana/ui';
import { addStandardDataReduceOptions } from '../stat/common';
@ -70,7 +69,7 @@ export const plugin = new PanelPlugin<PieChartOptions>(PieChartPanel)
{ value: PieChartLegendValues.Value, label: 'Value' },
],
},
showIf: (c) => c.legend.displayMode !== LegendDisplayMode.Hidden,
showIf: (c) => c.legend.showLegend !== false,
});
})
.setSuggestionsSupplier(new PieChartSuggestionsSupplier());