mirror of
https://github.com/apache/superset.git
synced 2026-04-22 09:35:23 +00:00
feat: Add ValuePercent option to LABEL TYPE for Pie and Funnel charts (#26407)
This commit is contained in:
@@ -124,6 +124,10 @@ const config: ControlPanelConfig = {
|
||||
EchartsFunnelLabelTypeType.KeyValuePercent,
|
||||
t('Category, Value and Percentage'),
|
||||
],
|
||||
[
|
||||
EchartsFunnelLabelTypeType.ValuePercent,
|
||||
t('Value and Percentage'),
|
||||
],
|
||||
],
|
||||
description: t('What should be shown as the label'),
|
||||
},
|
||||
|
||||
@@ -94,6 +94,8 @@ export function formatFunnelLabel({
|
||||
return `${name}: ${formattedValue} (${formattedPercent})`;
|
||||
case EchartsFunnelLabelTypeType.KeyPercent:
|
||||
return `${name}: ${formattedPercent}`;
|
||||
case EchartsFunnelLabelTypeType.ValuePercent:
|
||||
return `${formattedValue} (${formattedPercent})`;
|
||||
default:
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ export enum EchartsFunnelLabelTypeType {
|
||||
KeyValue,
|
||||
KeyPercent,
|
||||
KeyValuePercent,
|
||||
ValuePercent,
|
||||
}
|
||||
|
||||
export interface EchartsFunnelChartProps
|
||||
|
||||
Reference in New Issue
Block a user