feat(pie): add sort legend (#34323)

This commit is contained in:
SBIN2010
2025-08-29 22:19:14 +03:00
committed by GitHub
parent 54f071138c
commit dc7a8844eb
5 changed files with 128 additions and 2 deletions

View File

@@ -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],