Legends: Refactoring and rewrites of legend components to simplify components & reuse (#30165)

* Legends: Refactoring and rewrites of legend components to simplify components & reuse

* Removed onSeriesAxisToggle

* More removal of onSeriesAxisToggle and storybook improvements

* Added story with legend values

* Move table legend styles from inline to defined in stylesFactory

* Update styles

* Change to circle

* Updated style to fat line

* Rename to VizLegend

* More renamed and fixes / polish

* Removed imports

* Minor change

* Updates

* Updates
This commit is contained in:
Torkel Ödegaard
2021-01-12 15:58:46 +01:00
committed by GitHub
parent 807b31fb57
commit 5b022a1c75
31 changed files with 729 additions and 797 deletions

View File

@@ -1,4 +1,4 @@
import { LegendOptions, GraphTooltipOptions, LegendDisplayMode } from '@grafana/ui';
import { GraphTooltipOptions, LegendDisplayMode, LegendPlacement } from '@grafana/ui';
import { YAxis } from '@grafana/data';
export interface SeriesOptions {
@@ -14,7 +14,10 @@ export interface GraphOptions {
export interface Options {
graph: GraphOptions;
legend: LegendOptions & GraphLegendEditorLegendOptions;
legend: {
displayMode: LegendDisplayMode;
placement: LegendPlacement;
};
series: {
[alias: string]: SeriesOptions;
};
@@ -35,7 +38,9 @@ export const defaults: Options = {
tooltipOptions: { mode: 'single' },
};
export interface GraphLegendEditorLegendOptions extends LegendOptions {
export interface GraphLegendEditorLegendOptions {
displayMode: LegendDisplayMode;
placement: LegendPlacement;
stats?: string[];
decimals?: number;
sortBy?: string;