feat: Dynamic currency (#36416)

This commit is contained in:
Richard Fogaca Nienkotter
2026-01-17 02:58:41 -03:00
committed by GitHub
parent 896947c787
commit f4474b2e3e
72 changed files with 3068 additions and 173 deletions

View File

@@ -99,6 +99,7 @@ export default function transformProps(
datasource,
} = chartProps;
const data: DataRecord[] = queriesData[0].data || [];
const detectedCurrency = queriesData[0]?.detected_currency;
const coltypeMapping = getColtypesMapping(queriesData[0]);
const {
colorScheme,
@@ -127,7 +128,11 @@ export default function transformProps(
...DEFAULT_FUNNEL_FORM_DATA,
...formData,
};
const { currencyFormats = {}, columnFormats = {} } = datasource;
const {
currencyFormats = {},
columnFormats = {},
currencyCodeColumn,
} = datasource;
const refs: Refs = {};
const metricLabel = getMetricLabel(metric);
const groupbyLabels = groupby.map(getColumnLabel);
@@ -154,6 +159,10 @@ export default function transformProps(
columnFormats,
numberFormat,
currencyFormat,
undefined,
data,
currencyCodeColumn,
detectedCurrency,
);
const transformedData: {