You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jl...@apache.org on 2025/03/04 18:20:54 UTC

(superset) 07/08: fix(sunburst): Use metric label from verbose map (#31480)

This is an automated email from the ASF dual-hosted git repository.

jli pushed a commit to branch 4.1
in repository https://gitbox.apache.org/repos/asf/superset.git

commit e16d574f28dde2b41388f61e7c725a61483b0046
Author: Michael Gerber <mi...@nxt.engineering>
AuthorDate: Mon Dec 16 18:44:33 2024 +0100

    fix(sunburst): Use metric label from verbose map (#31480)
    
    (cherry picked from commit a1adb7f31cdd0fe340040f8e721b5753a23305c4)
---
 .../plugin-chart-echarts/src/Sunburst/transformProps.ts      | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/transformProps.ts
index 77888c64c4..853721b292 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/transformProps.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/transformProps.ts
@@ -188,7 +188,11 @@ export default function transformProps(
     showTotal,
     sliceId,
   } = formData;
-  const { currencyFormats = {}, columnFormats = {} } = datasource;
+  const {
+    currencyFormats = {},
+    columnFormats = {},
+    verboseMap = {},
+  } = datasource;
   const refs: Refs = {};
   const primaryValueFormatter = getValueFormatter(
     metric,
@@ -334,8 +338,10 @@ export default function transformProps(
           secondaryValueFormatter,
           colorByCategory,
           totalValue,
-          metricLabel,
-          secondaryMetricLabel,
+          metricLabel: verboseMap[metricLabel] || metricLabel,
+          secondaryMetricLabel: secondaryMetricLabel
+            ? verboseMap[secondaryMetricLabel] || secondaryMetricLabel
+            : undefined,
         }),
     },
     series: [