mirror of
https://github.com/apache/superset.git
synced 2026-04-25 19:14:27 +00:00
feat(pie): add sort legend (#34323)
This commit is contained in:
@@ -97,6 +97,24 @@ const legendOrientationControl: ControlSetItem = {
|
||||
},
|
||||
};
|
||||
|
||||
export const legendSortControl: ControlSetItem = {
|
||||
name: 'legendSort',
|
||||
config: {
|
||||
type: 'SelectControl',
|
||||
label: t('Sort legend'),
|
||||
default: null,
|
||||
renderTrigger: true,
|
||||
choices: [
|
||||
['asc', t('Label ascending')],
|
||||
['desc', t('Label descending')],
|
||||
[null, t('Sort by data')],
|
||||
],
|
||||
description: t('Changes the sort value of the items in the legend only'),
|
||||
visibility: ({ controls }: ControlPanelsContainerProps) =>
|
||||
Boolean(controls?.show_legend?.value),
|
||||
},
|
||||
};
|
||||
|
||||
export const legendSection: ControlSetRow[] = [
|
||||
[<ControlSubSectionHeader>{t('Legend')}</ControlSubSectionHeader>],
|
||||
[showLegendControl],
|
||||
|
||||
Reference in New Issue
Block a user