rusackas commented on code in PR #43457:
URL: https://github.com/apache/superset/pull/43457#discussion_r3966434434


##########
superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/transformProps.ts:
##########
@@ -219,9 +219,19 @@ export default function transformProps(chartProps: 
ChartProps<QueryFormData>) {
       config.colorScheme !== ColorSchemeEnum.Green &&
       config.colorScheme !== ColorSchemeEnum.Red,
   );
+  // Conditional-formatting extremes (min/max) must be computed from every
+  // rollup level that actually gets rendered -- leaf rows, subtotals, and
+  // the grand total -- not just the leaf-level `mainQuery.data`. Subtotal
+  // and grand-total values are synthesized client-side into `data` above
+  // and never appear in `mainQuery.data`, so a color scale built only from
+  // `mainQuery.data` can be miscalibrated: a large grand-total value can
+  // fall outside the scale's range and silently fail to receive a color,
+  // while smaller leaf-level values within range render as expected.
+  // See #43084.
+  const allLevelRecords = data.flatMap(level => level.data);

Review Comment:
   Agreed, this is a real gap. `buildGroupbyCombinations` forces in the 
collapsed denominator level for a percent `showValuesAs` even when 
`colTotals`/`rowTotals` is off (see the comment above it), so that level's rows 
are hidden from rendering but still land in `data` and skew the min/max this PR 
feeds into `getColorFormatters`.



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