mirror of https://github.com/apache/superset.git
fix(big-number-chart): number format is not applying to percentage number of the time comparison (#27502)
This commit is contained in:
parent
6b529a4b68
commit
d2c90013fc
|
@ -118,6 +118,15 @@ const config: ControlPanelConfig = {
|
|||
expanded: true,
|
||||
controlSetRows: [
|
||||
['y_axis_format'],
|
||||
[
|
||||
{
|
||||
name: 'percentDifferenceFormat',
|
||||
config: {
|
||||
...sharedControls.y_axis_format,
|
||||
label: t('Percent Difference format'),
|
||||
},
|
||||
},
|
||||
],
|
||||
['currency_format'],
|
||||
[
|
||||
{
|
||||
|
|
|
@ -21,7 +21,6 @@ import {
|
|||
ChartProps,
|
||||
getMetricLabel,
|
||||
getValueFormatter,
|
||||
NumberFormats,
|
||||
getNumberFormatter,
|
||||
formatTimeRange,
|
||||
} from '@superset-ui/core';
|
||||
|
@ -84,6 +83,7 @@ export default function transformProps(chartProps: ChartProps) {
|
|||
currencyFormat,
|
||||
subheaderFontSize,
|
||||
comparisonColorEnabled,
|
||||
percentDifferenceFormat,
|
||||
} = formData;
|
||||
const { data: dataA = [] } = queriesData[0];
|
||||
const {
|
||||
|
@ -113,9 +113,7 @@ export default function transformProps(chartProps: ChartProps) {
|
|||
w: 'Week' as string,
|
||||
};
|
||||
|
||||
const formatPercentChange = getNumberFormatter(
|
||||
NumberFormats.PERCENT_SIGNED_1_POINT,
|
||||
);
|
||||
const formatPercentChange = getNumberFormatter(percentDifferenceFormat);
|
||||
|
||||
let valueDifference: number | string = bigNumber - prevNumber;
|
||||
|
||||
|
|
Loading…
Reference in New Issue