fix: Timeseries Y-axis format with contribution mode (#27106)

This commit is contained in:
Michael S. Molina
2024-02-14 09:41:22 -05:00
committed by GitHub
parent 13f1642c73
commit af577d64b1
6 changed files with 56 additions and 6 deletions

View File

@@ -95,6 +95,7 @@ import {
} from '../constants';
import { getDefaultTooltip } from '../utils/tooltip';
import {
getPercentFormatter,
getTooltipTimeFormatter,
getXAxisFormatter,
getYAxisFormatter,
@@ -253,7 +254,7 @@ export default function transformProps(
const series: SeriesOption[] = [];
const forcePercentFormatter = Boolean(contributionMode || isAreaExpand);
const percentFormatter = getNumberFormatter(',.0%');
const percentFormatter = getPercentFormatter(yAxisFormat);
const defaultFormatter = currencyFormat?.symbol
? new CurrencyFormatter({ d3Format: yAxisFormat, currency: currencyFormat })
: getNumberFormatter(yAxisFormat);
@@ -486,6 +487,7 @@ export default function transformProps(
forcePercentFormatter,
customFormatters,
defaultFormatter,
yAxisFormat,
),
},
scale: truncateYAxis,