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


##########
superset-frontend/plugins/plugin-chart-echarts/src/Bullet/transformProps.ts:
##########
@@ -102,23 +128,48 @@ export default function transformProps(
     theme.colorFillSecondary,
     theme.colorFill,
   ];
+  // Custom colors (if any) are authored positionally against the original,
+  // pre-sort `ranges` order via the `range_colors` control -- capture each
+  // range's color here, before the descending sort below reorders them.
   const sortedRanges = [...ranges]
-    .map((value, i) => ({ value, label: rangeLabels[i] }))
+    .map((value, i) => ({
+      value,
+      label: rangeLabels[i],
+      color: rangeColors?.[i] || undefined,

Review Comment:
   The picked colors are applied here even when `ranges` is empty and the band 
comes from the automatic fallback (`[0, measure * 1.1]`). `range_colors` keeps 
its value on hide (`resetOnHide: false`), so a user who sets ranges `50,100` 
with red/green, then clears Ranges, still gets the fallback band painted green 
from the hidden `range_colors[1]`, and that is saved with no visible control to 
reset it. Should the colors only apply while `rawRanges` actually yields 
explicit thresholds?



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