mirror of
https://github.com/apache/superset.git
synced 2026-05-12 11:25:56 +00:00
feat(MixedTimeSeries): Add onlyTotal and Sort Series to Mixed TimeSeries (#33634)
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
import { ensureIsArray, t } from '@superset-ui/core';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import {
|
||||
ControlPanelsContainerProps,
|
||||
ControlPanelConfig,
|
||||
ControlPanelSectionConfig,
|
||||
ControlSetRow,
|
||||
@@ -27,6 +28,8 @@ import {
|
||||
getStandardizedControls,
|
||||
sections,
|
||||
sharedControls,
|
||||
DEFAULT_SORT_SERIES_DATA,
|
||||
SORT_SERIES_CHOICES,
|
||||
} from '@superset-ui/chart-controls';
|
||||
|
||||
import { DEFAULT_FORM_DATA } from './types';
|
||||
@@ -196,6 +199,23 @@ function createCustomizeSection(
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
name: `only_total${controlSuffix}`,
|
||||
config: {
|
||||
type: 'CheckboxControl',
|
||||
label: t('Only Total'),
|
||||
default: true,
|
||||
renderTrigger: true,
|
||||
description: t(
|
||||
'Only show the total value on the stacked chart, and not show on the selected category',
|
||||
),
|
||||
visibility: ({ controls }: ControlPanelsContainerProps) =>
|
||||
Boolean(controls?.show_value?.value) &&
|
||||
Boolean(controls?.stack?.value),
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
name: `opacity${controlSuffix}`,
|
||||
@@ -258,6 +278,35 @@ function createCustomizeSection(
|
||||
},
|
||||
},
|
||||
],
|
||||
[<ControlSubSectionHeader>{t('Series Order')}</ControlSubSectionHeader>],
|
||||
[
|
||||
{
|
||||
name: `sort_series_type${controlSuffix}`,
|
||||
config: {
|
||||
type: 'SelectControl',
|
||||
freeForm: false,
|
||||
label: t('Sort Series By'),
|
||||
choices: SORT_SERIES_CHOICES,
|
||||
default: DEFAULT_SORT_SERIES_DATA.sort_series_type,
|
||||
renderTrigger: true,
|
||||
description: t(
|
||||
'Based on what should series be ordered on the chart and legend',
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
name: `sort_series_ascending${controlSuffix}`,
|
||||
config: {
|
||||
type: 'CheckboxControl',
|
||||
label: t('Sort Series Ascending'),
|
||||
default: DEFAULT_SORT_SERIES_DATA.sort_series_ascending,
|
||||
renderTrigger: true,
|
||||
description: t('Sort series in ascending order'),
|
||||
},
|
||||
},
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user