Time series/Bar chart panel: Add ability to sort series via legend (#40226)

* Make legend sorting work in Time series panel

* Import from schema

Add properties to the cue schema as well

* Order stacking

* Add tests for orderIdsByCalcs

* Add check for legend options

* Fix cue schema

* UI fixes

* Order bars as well in barchart

* Use different index when ordered

* Legend sort series doc

* Fix nits

* Update docs/sources/panels/legend-options.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Fix linting

* Apply suggestions from code review

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Update docs/sources/panels/legend-options.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
This commit is contained in:
Zoltán Bedi
2021-10-25 11:21:51 +02:00
committed by GitHub
parent d5de885633
commit e6d2324516
18 changed files with 340 additions and 62 deletions

View File

@@ -258,6 +258,8 @@ export interface VizLegendOptions {
displayMode: LegendDisplayMode;
isVisible?: boolean;
placement: LegendPlacement;
sortBy?: string;
sortDesc?: boolean;
}
export enum BarGaugeDisplayMode {

View File

@@ -5,9 +5,11 @@ LegendPlacement: "bottom" | "right" @cuetsy(kind="type")
LegendDisplayMode: "list" | "table" | "hidden" @cuetsy(kind="enum")
VizLegendOptions: {
displayMode: LegendDisplayMode
placement: LegendPlacement
displayMode: LegendDisplayMode
placement: LegendPlacement
asTable?: bool
isVisible?: bool
calcs: [...string]
sortBy?: string
sortDesc?: bool
calcs: [...string]
} @cuetsy(kind="interface")