geido commented on a change in pull request #17792:
URL: https://github.com/apache/superset/pull/17792#discussion_r782217960



##########
File path: superset-frontend/src/explore/components/ExploreChartHeader/index.jsx
##########
@@ -157,13 +157,26 @@ export class ExploreChartHeader extends 
React.PureComponent {
 
           if (dashboard && dashboard.json_metadata) {
             // setting the chart to use the dashboard custom label colors if 
any
-            const labelColors =
-              JSON.parse(dashboard.json_metadata).label_colors || {};
+            const metadata = JSON.parse(dashboard.json_metadata);
+            const sharedLabelColors = metadata.shared_label_colors || {};
+            const labelColors = metadata.label_colors || {};
+
             const categoricalNamespace =
               CategoricalColorNamespace.getNamespace();
 
+            Object.keys(sharedLabelColors).forEach(label => {
+              categoricalNamespace.setColor(
+                label,
+                sharedLabelColors[label],
+                metadata.color_scheme,
+              );
+            });
             Object.keys(labelColors).forEach(label => {
-              categoricalNamespace.setColor(label, labelColors[label]);
+              categoricalNamespace.setColor(
+                label,
+                labelColors[label],
+                metadata.color_scheme,
+              );

Review comment:
       If that helps bring more clarity to the backend code, I'd say yes. 
However, I am happy with changing it on the frontend only for now




-- 
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: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to