GitHub user miguelargueta created a discussion: How to set custom colors and 
specific category order in Bar Chart (Superset 4.1.1)?


Hi everyone,

I'm working with Apache Superset 4.1.1, and I'm trying to build a Bar Chart 
that displays the number of students by gender (sexo), broken down by belt 
color (cinta_general), based on a dataset of student evaluations.

What I’m trying to achieve:
Assign specific colors to each cinta_general category:
"black" → #000000
"blue" → #0000FF
"yellow" → #FFD700
"white" → #FFFFFF

Display these categories in a fixed custom order:

black, blue, yellow, white

![Image](https://github.com/user-attachments/assets/e5f93c5b-6403-4e44-ac86-15549981c4e6)
The current order being displayed is: black, white, blue, and yellow.

What I’ve done so far:
I'm currently using the Bar Chart visualization (likely the ECharts version).
In the Data panel:
Dimensions: sexo
Breakdowns: cinta_general
Metrics: count(*)
In the Customize panel, I see options like:
Color Scheme, Stacked Bars, Sort Bars, Legend, Tooltip, Y Axis Format, etc.
I do not see options for:
Customize Series (to assign individual colors)

Other things I’ve tried:
I created a field called orden_cinta in the SQL query (using CASE WHEN) to 
represent the desired sort order, but I can't use this to control the visual 
order in the chart.
Switching chart types to Pie, Line, or Mixed doesn’t help.
I also tried selecting what’s labeled as “Bar Chart (Legacy)”, but it appears 
to be the same modern ECharts chart, with the same fields and limitations — no 
Group by, no Columns, no Customize Series.
Series Order (to define a custom order for the breakdown categories)
My question:
How can I assign custom colors by category and define a specific display order 
for those categories in a Bar Chart in Superset 4.1.1?

Do I need to use a specific chart type (like a real Legacy chart), adjust 
Superset feature flags or config files, or is there a workaround using the 
current ECharts bar chart?

Any help, examples, or links would be greatly appreciated!
Thanks in advance 



GitHub link: https://github.com/apache/superset/discussions/36148

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


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

Reply via email to