mirror of
https://github.com/apache/superset.git
synced 2026-04-21 00:54:44 +00:00
feat: add sort legend to legend section (#34911)
This commit is contained in:
@@ -116,6 +116,7 @@ export default function transformProps(
|
||||
dateFormat,
|
||||
showLabels,
|
||||
showLegend,
|
||||
legendSort,
|
||||
isCircle,
|
||||
columnConfig,
|
||||
sliceId,
|
||||
@@ -354,7 +355,10 @@ export default function transformProps(
|
||||
},
|
||||
legend: {
|
||||
...getLegendProps(legendType, legendOrientation, showLegend, theme),
|
||||
data: Array.from(columnsLabelMap.keys()),
|
||||
data: Array.from(columnsLabelMap.keys()).sort((a: string, b: string) => {
|
||||
if (!legendSort) return 0;
|
||||
return legendSort === 'asc' ? a.localeCompare(b) : b.localeCompare(a);
|
||||
}),
|
||||
},
|
||||
series,
|
||||
radar: {
|
||||
|
||||
Reference in New Issue
Block a user