mirror of
https://github.com/apache/superset.git
synced 2026-04-27 03:55:47 +00:00
fix: Time-series Line Chart Display unnecessary total (#31181)
This commit is contained in:
committed by
GitHub
parent
f0811c8863
commit
dbcb473040
@@ -210,9 +210,40 @@ const tooltipSortByMetricControl: ControlSetItem = {
|
||||
},
|
||||
};
|
||||
|
||||
const tooltipTotalControl: ControlSetItem = {
|
||||
name: 'showTooltipTotal',
|
||||
config: {
|
||||
type: 'CheckboxControl',
|
||||
label: t('Show total'),
|
||||
renderTrigger: true,
|
||||
default: true,
|
||||
description: t('Whether to display the total value in the tooltip'),
|
||||
visibility: ({ controls, form_data }: ControlPanelsContainerProps) =>
|
||||
Boolean(controls?.rich_tooltip?.value) &&
|
||||
form_data.viz_type !== 'mixed_timeseries',
|
||||
},
|
||||
};
|
||||
|
||||
const tooltipPercentageControl: ControlSetItem = {
|
||||
name: 'showTooltipPercentage',
|
||||
config: {
|
||||
type: 'CheckboxControl',
|
||||
label: t('Show percentage'),
|
||||
renderTrigger: true,
|
||||
default: true,
|
||||
description: t('Whether to display the percentage value in the tooltip'),
|
||||
visibility: ({ controls, form_data }: ControlPanelsContainerProps) =>
|
||||
Boolean(controls?.rich_tooltip?.value) &&
|
||||
!controls?.contributionMode?.value &&
|
||||
form_data.viz_type !== 'mixed_timeseries',
|
||||
},
|
||||
};
|
||||
|
||||
export const richTooltipSection: ControlSetRow[] = [
|
||||
[<ControlSubSectionHeader>{t('Tooltip')}</ControlSubSectionHeader>],
|
||||
[richTooltipControl],
|
||||
[tooltipTotalControl],
|
||||
[tooltipPercentageControl],
|
||||
[tooltipSortByMetricControl],
|
||||
[tooltipTimeFormatControl],
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user