mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
feat: Add currencies controls in control panels (#24718)
This commit is contained in:
committed by
GitHub
parent
1a9c559a8f
commit
f7e76d02b7
@@ -140,6 +140,7 @@ export default function PivotTableChart(props: PivotTableProps) {
|
||||
colTotals,
|
||||
rowTotals,
|
||||
valueFormat,
|
||||
currencyFormat,
|
||||
emitCrossFilters,
|
||||
setDataMask,
|
||||
selectedFilters,
|
||||
@@ -155,8 +156,14 @@ export default function PivotTableChart(props: PivotTableProps) {
|
||||
|
||||
const theme = useTheme();
|
||||
const defaultFormatter = useMemo(
|
||||
() => getNumberFormatter(valueFormat),
|
||||
[valueFormat],
|
||||
() =>
|
||||
currencyFormat?.symbol
|
||||
? new CurrencyFormatter({
|
||||
currency: currencyFormat,
|
||||
d3Format: valueFormat,
|
||||
})
|
||||
: getNumberFormatter(valueFormat),
|
||||
[valueFormat, currencyFormat],
|
||||
);
|
||||
const customFormatsArray = useMemo(
|
||||
() =>
|
||||
@@ -168,9 +175,9 @@ export default function PivotTableChart(props: PivotTableProps) {
|
||||
).map(metricName => [
|
||||
metricName,
|
||||
columnFormats[metricName] || valueFormat,
|
||||
currencyFormats[metricName],
|
||||
currencyFormats[metricName] || currencyFormat,
|
||||
]),
|
||||
[columnFormats, currencyFormats, valueFormat],
|
||||
[columnFormats, currencyFormat, currencyFormats, valueFormat],
|
||||
);
|
||||
const hasCustomMetricFormatters = customFormatsArray.length > 0;
|
||||
const metricFormatters = useMemo(
|
||||
|
||||
Reference in New Issue
Block a user