mirror of
https://github.com/apache/superset.git
synced 2026-04-24 18:44:53 +00:00
feat: add sort legend to legend section (#34911)
This commit is contained in:
@@ -158,6 +158,7 @@ export default function transformProps(
|
||||
contributionMode,
|
||||
legendOrientation,
|
||||
legendType,
|
||||
legendSort,
|
||||
logAxis,
|
||||
logAxisSecondary,
|
||||
markerEnabled,
|
||||
@@ -724,7 +725,11 @@ export default function transformProps(
|
||||
ForecastSeriesEnum.Observation,
|
||||
)
|
||||
.map(entry => entry.id || entry.name || '')
|
||||
.concat(extractAnnotationLabels(annotationLayers)),
|
||||
.concat(extractAnnotationLabels(annotationLayers))
|
||||
.sort((a: string, b: string) => {
|
||||
if (!legendSort) return 0;
|
||||
return legendSort === 'asc' ? a.localeCompare(b) : b.localeCompare(a);
|
||||
}),
|
||||
},
|
||||
series: dedupSeries(reorderForecastSeries(series) as SeriesOption[]),
|
||||
toolbox: {
|
||||
|
||||
Reference in New Issue
Block a user