mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
feat: Funnel/tooltip-customization (#25666)
This commit is contained in:
@@ -64,6 +64,7 @@ export function formatFunnelLabel({
|
||||
const name = sanitizeName ? sanitizeHtml(rawName) : rawName;
|
||||
const formattedValue = numberFormatter(value as number);
|
||||
const formattedPercent = percentFormatter((percent as number) / 100);
|
||||
|
||||
switch (labelType) {
|
||||
case EchartsFunnelLabelTypeType.Key:
|
||||
return name;
|
||||
@@ -93,7 +94,6 @@ export default function transformProps(
|
||||
queriesData,
|
||||
width,
|
||||
theme,
|
||||
inContextMenu,
|
||||
emitCrossFilters,
|
||||
datasource,
|
||||
} = chartProps;
|
||||
@@ -107,6 +107,7 @@ export default function transformProps(
|
||||
gap,
|
||||
labelLine,
|
||||
labelType,
|
||||
tooltipLabelType,
|
||||
legendMargin,
|
||||
legendOrientation,
|
||||
legendType,
|
||||
@@ -114,6 +115,8 @@ export default function transformProps(
|
||||
numberFormat,
|
||||
currencyFormat,
|
||||
showLabels,
|
||||
inContextMenu,
|
||||
showTooltipLabels,
|
||||
showLegend,
|
||||
sliceId,
|
||||
}: EchartsFunnelFormData = {
|
||||
@@ -227,13 +230,13 @@ export default function transformProps(
|
||||
},
|
||||
tooltip: {
|
||||
...getDefaultTooltip(refs),
|
||||
show: !inContextMenu,
|
||||
show: !inContextMenu && showTooltipLabels,
|
||||
trigger: 'item',
|
||||
formatter: (params: any) =>
|
||||
formatFunnelLabel({
|
||||
params,
|
||||
numberFormatter,
|
||||
labelType: EchartsFunnelLabelTypeType.KeyValuePercent,
|
||||
labelType: tooltipLabelType,
|
||||
}),
|
||||
},
|
||||
legend: {
|
||||
|
||||
Reference in New Issue
Block a user