diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx index 3acefb6e3fe52..99ec771d1ed9e 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx @@ -37,7 +37,7 @@ import { seriesOrderSection, percentageThresholdControl, } from '../../controls'; -import { AreaChartExtraControlsOptions } from '../../constants'; +import { AreaChartStackControlOptions } from '../../constants'; const { logAxis, @@ -110,7 +110,7 @@ const config: ControlPanelConfig = { type: 'SelectControl', label: t('Stacked Style'), renderTrigger: true, - choices: AreaChartExtraControlsOptions, + choices: AreaChartStackControlOptions, default: null, description: t('Stack series on top of each other'), }, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/components/ExtraControls.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/components/ExtraControls.tsx index 10217b3add730..33e9ab016eb0e 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/components/ExtraControls.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/components/ExtraControls.tsx @@ -22,7 +22,7 @@ import { RadioButtonOption, sharedControlComponents, } from '@superset-ui/chart-controls'; -import { AreaChartExtraControlsOptions } from '../constants'; +import { AreaChartStackControlOptions } from '../constants'; const { RadioButtonControl } = sharedControlComponents; @@ -53,7 +53,7 @@ export function useExtraControl< const extraControlsOptions = useMemo(() => { if (area) { - return AreaChartExtraControlsOptions; + return AreaChartStackControlOptions; } return []; }, [area]); diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/constants.ts b/superset-frontend/plugins/plugin-chart-echarts/src/constants.ts index 05292b7f40d93..bfc6c98fa5afa 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/constants.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/constants.ts @@ -77,7 +77,7 @@ export enum StackControlsValue { Expand = 'Expand', } -export const ExtraControlsOptions: [ +export const StackControlOptions: [ JsonValue, Exclude, ][] = [ @@ -86,15 +86,10 @@ export const ExtraControlsOptions: [ [StackControlsValue.Stream, t('Stream')], ]; -export const AreaChartExtraControlsOptions: [ +export const AreaChartStackControlOptions: [ JsonValue, Exclude, -][] = [ - [null, t('None')], - [StackControlsValue.Stack, t('Stack')], - [StackControlsValue.Stream, t('Stream')], - [StackControlsValue.Expand, t('Expand')], -]; +][] = [...StackControlOptions, [StackControlsValue.Expand, t('Expand')]]; export const TIMEGRAIN_TO_TIMESTAMP = { [TimeGranularity.HOUR]: 3600 * 1000, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx index fb064d8fca7a9..26f10e0fe45ed 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx @@ -27,7 +27,7 @@ import { import { DEFAULT_LEGEND_FORM_DATA, DEFAULT_SORT_SERIES_DATA, - ExtraControlsOptions, + StackControlOptions, } from './constants'; import { DEFAULT_FORM_DATA } from './Timeseries/constants'; import { SortSeriesType } from './types'; @@ -123,7 +123,7 @@ export const stackControl: ControlSetItem = { type: 'SelectControl', label: t('Stacked Style'), renderTrigger: true, - choices: ExtraControlsOptions, + choices: StackControlOptions, default: null, description: t('Stack series on top of each other'), },