Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

Commit 96e9d75

Browse files
committed
style: overwriting yAxisFormat rather than declaring a new var
1 parent db1153c commit 96e9d75

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/superset-ui-legacy-preset-chart-big-number/src/BigNumber/transformProps.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export default function transformProps(chartProps) {
3636
startYAxisAtZero,
3737
subheader = '',
3838
vizType,
39-
yAxisFormat,
4039
} = formData;
40+
let { yAxisFormat } = formData;
4141
const { data } = queryData;
4242

4343
let mainColor;
@@ -84,16 +84,16 @@ export default function transformProps(chartProps) {
8484
} else if (percentChange < 0) {
8585
className = 'negative';
8686
}
87-
let metricFormat = yAxisFormat;
87+
8888
if (!yAxisFormat && chartProps.datasource && chartProps.datasource.metrics) {
8989
chartProps.datasource.metrics.forEach(metricEntry => {
9090
if (metricEntry.metric_name === metric && metricEntry.d3format) {
91-
metricFormat = metricEntry.d3format;
91+
yAxisFormat = metricEntry.d3format;
9292
}
9393
});
9494
}
9595

96-
const formatValue = getNumberFormatter(metricFormat);
96+
const formatValue = getNumberFormatter(yAxisFormat);
9797

9898
return {
9999
width,

0 commit comments

Comments
 (0)