mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
fix: apply d3 format to BigNumber(s) (#33759)
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { Metric } from '@superset-ui/chart-controls';
|
||||
import {
|
||||
ChartProps,
|
||||
getMetricLabel,
|
||||
@@ -113,6 +114,13 @@ export default function transformProps(chartProps: ChartProps) {
|
||||
adhoc_filter.operator === 'TEMPORAL_RANGE',
|
||||
)?.[0];
|
||||
|
||||
let metricEntry: Metric | undefined;
|
||||
if (chartProps.datasource?.metrics) {
|
||||
metricEntry = chartProps.datasource.metrics.find(
|
||||
metricItem => metricItem.metric_name === metric,
|
||||
);
|
||||
}
|
||||
|
||||
const isCustomOrInherit =
|
||||
timeComparison === 'custom' || timeComparison === 'inherit';
|
||||
let dataOffset: string[] = [];
|
||||
@@ -153,7 +161,7 @@ export default function transformProps(chartProps: ChartProps) {
|
||||
metric,
|
||||
currencyFormats,
|
||||
columnFormats,
|
||||
yAxisFormat,
|
||||
metricEntry?.d3format || yAxisFormat,
|
||||
currencyFormat,
|
||||
);
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ export default function transformProps(
|
||||
metric,
|
||||
currencyFormats,
|
||||
columnFormats,
|
||||
yAxisFormat,
|
||||
metricEntry?.d3format || yAxisFormat,
|
||||
currencyFormat,
|
||||
);
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ export default function transformProps(
|
||||
metric,
|
||||
currencyFormats,
|
||||
columnFormats,
|
||||
yAxisFormat,
|
||||
metricEntry?.d3format || yAxisFormat,
|
||||
currencyFormat,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user