mirror of
https://github.com/apache/superset.git
synced 2026-04-23 18:14:56 +00:00
feat: Add ValuePercent option to LABEL TYPE for Pie and Funnel charts (#26407)
This commit is contained in:
@@ -107,6 +107,7 @@ const config: ControlPanelConfig = {
|
||||
['key_value', t('Category and Value')],
|
||||
['key_percent', t('Category and Percentage')],
|
||||
['key_value_percent', t('Category, Value and Percentage')],
|
||||
['value_percent', t('Value and Percentage')],
|
||||
],
|
||||
description: t('What should be shown on the label?'),
|
||||
},
|
||||
|
||||
@@ -80,6 +80,8 @@ export function formatPieLabel({
|
||||
return `${name}: ${formattedValue} (${formattedPercent})`;
|
||||
case EchartsPieLabelType.KeyPercent:
|
||||
return `${name}: ${formattedPercent}`;
|
||||
case EchartsPieLabelType.ValuePercent:
|
||||
return `${formattedValue} (${formattedPercent})`;
|
||||
default:
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ export enum EchartsPieLabelType {
|
||||
KeyValue = 'key_value',
|
||||
KeyPercent = 'key_percent',
|
||||
KeyValuePercent = 'key_value_percent',
|
||||
ValuePercent = 'value_percent',
|
||||
}
|
||||
|
||||
export interface EchartsPieChartProps
|
||||
|
||||
Reference in New Issue
Block a user