sadpandajoe commented on code in PR #43113:
URL: https://github.com/apache/superset/pull/43113#discussion_r3912287312


##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts:
##########
@@ -1435,6 +1449,29 @@ export default function transformProps(
             value.forecastTrend || value.forecastLower || value.forecastUpper,
         );
 
+        // Resolve the value formatter per series so each metric keeps its own
+        // D3/currency format, matching how the series labels are formatted.
+        // Without the series key, `getCustomFormatter` returns undefined for
+        // multi-metric charts and every row falls back to `defaultFormatter`,
+        // rendering the y-axis/currency format for all metrics.
+        //
+        // The tooltip key is the rendered series name, so resolve it through
+        // `labelMap`, whose values lead with the raw metric label. Series
+        // renamed by a verbose_name are absent from that map, so fall back to
+        // the verbose-name inversion, as MixedTimeseries does. A Percentage
+        // comparison row is a ratio rather than a value in the metric's units,
+        // so it takes the percent formatter instead of the metric's own 
format.
+        const getSeriesFormatter = (seriesKey: string) =>
+          forcePercentFormatter || isPercentageComparisonSeries(seriesKey)

Review Comment:
   A Ratio time comparison is unitless too, but this condition only bypasses 
the metric formatter for Percentage. With a currency-formatted metric, its 
derived Ratio row is still routed through `CurrencyFormatter` and can render `$ 
0.25` instead of a ratio. Could this handle Ratio-derived rows with a unitless 
formatter and add that fixture?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to