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

Commit db1153c

Browse files
committed
fix: allow formData to override metric's D3 Format
1 parent 95e2638 commit db1153c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/superset-ui-legacy-preset-chart-nvd3/src/transformProps.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ export default function transformProps(chartProps) {
9090
: rawData;
9191

9292
if (chartProps.formData.vizType === 'pie') {
93-
numberFormat = grabD3Format(chartProps, chartProps.formData.metric) || numberFormat;
93+
numberFormat = numberFormat || grabD3Format(chartProps, chartProps.formData.metric);
9494
} else if (chartProps.formData.vizType === 'dual_line') {
95-
yAxisFormat = grabD3Format(chartProps, chartProps.formData.metric) || yAxisFormat;
96-
yAxis2Format = grabD3Format(chartProps, chartProps.formData.metric2) || yAxis2Format;
95+
yAxisFormat = yAxisFormat || grabD3Format(chartProps, chartProps.formData.metric);
96+
yAxis2Format = yAxis2Format || grabD3Format(chartProps, chartProps.formData.metric2);
9797
} else if (['line', 'dist_bar', 'bar', 'area'].indexOf(chartProps.formData.vizType) > -1) {
98-
yAxisFormat = grabD3Format(chartProps, chartProps.formData.metrics[0]) || yAxisFormat;
98+
yAxisFormat = yAxisFormat || grabD3Format(chartProps, chartProps.formData.metrics[0]);
9999
}
100100

101101
return {

0 commit comments

Comments
 (0)