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


##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts:
##########
@@ -593,6 +594,20 @@ export default function transformProps(
   const array = ensureIsArray(chartProps.rawFormData?.time_compare);
   const inverted = invert(verboseMap);
 
+  // A Percentage time comparison replaces the derived series' values with a
+  // ratio, so that row is no longer in the source metric's units and must not
+  // inherit its currency/D3 format. `renameOperator` labels those series with
+  // the offset alone, or `<metric>, <offset>` when several metrics are 
plotted.
+  const percentageComparisonSeries = new Set<string>(
+    chartProps.rawFormData?.comparison_type === ComparisonType.Percentage
+      ? array.flatMap(offset =>
+          rawValueMetricLabels.length > 1

Review Comment:
   A grouped Percentage comparison is named `1 week ago, East` (or `<metric>, 1 
week ago, East`), which is not one of the exact keys added here. It therefore 
falls through to the source metric's formatter and can still show `$ 0.25` 
instead of `25.00%`. Could this detect the time-offset portion of derived 
series rather than matching only the dimensionless names, and add a grouped 
regression?



-- 
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