mirror of
https://github.com/apache/superset.git
synced 2026-04-27 12:05:24 +00:00
feat(echarts-pie): add string template support for labels (#28774)
This commit is contained in:
@@ -123,11 +123,31 @@ const config: ControlPanelConfig = {
|
||||
['key_percent', t('Category and Percentage')],
|
||||
['key_value_percent', t('Category, Value and Percentage')],
|
||||
['value_percent', t('Value and Percentage')],
|
||||
['template', t('Template')],
|
||||
],
|
||||
description: t('What should be shown on the label?'),
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
name: 'label_template',
|
||||
config: {
|
||||
type: 'TextControl',
|
||||
label: t('Label Template'),
|
||||
renderTrigger: true,
|
||||
description: t(
|
||||
'Format data labels. ' +
|
||||
'Use variables: {name}, {value}, {percent}. ' +
|
||||
'\\n represents a new line. ' +
|
||||
'ECharts compatibility:\n' +
|
||||
'{a} (series), {b} (name), {c} (value), {d} (percentage)',
|
||||
),
|
||||
visibility: ({ controls }: ControlPanelsContainerProps) =>
|
||||
controls?.label_type?.value === 'template',
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
name: 'number_format',
|
||||
|
||||
Reference in New Issue
Block a user