GitHub user dosubot[bot] added a comment to the discussion: Custom Colour Pallet

<!-- Answer -->
To add a custom colour palette for charts in Superset 5.0.0, you can define 
your palette in the configuration file (usually superset/config.py) using the 
EXTRA_CATEGORICAL_COLOR_SCHEMES or EXTRA_SEQUENTIAL_COLOR_SCHEMES lists. For 
example:

```python
EXTRA_CATEGORICAL_COLOR_SCHEMES = [
    {
        "id": "myVisualizationColors",
        "description": "My custom palette",
        "label": "My Visualization Colors",
        "isDefault": True,
        "colors": [
            "#006699", "#009DD9", "#5AAA46", "#44AAAA", "#DDAA77",
            "#7799BB", "#88AA77", "#552288", "#CC7788", "#EEDD55",
            "#9977BB", "#BBAA44", "#DDCCDD"
        ]
    }
]
```

You can do the same for sequential palettes with 
EXTRA_SEQUENTIAL_COLOR_SCHEMES. After updating the config, restart Superset for 
the changes to take effect. These palettes will then be available in the chart 
colour scheme selectors. More details and examples are in the config file 
comments 
["here"](https://github.com/apache/superset/blob/master/superset/config.py).

For ECharts-based visualizations, you can also apply chart-specific color 
overrides using the echartsOptionsOverridesByChartType property in the theme 
configuration. This allows you to set colors and other visual properties for 
specific chart types ["details"](https://github.com/apache/superset/pull/36389).

Some plugins (like CountryMap) and certain charts support custom color scales 
via a JSON customization block in the Chart Options panel, and recent UI 
changes allow you to pick any valid CSS color using a color selector for 
supported charts ["details"](https://github.com/apache/superset/pull/36732).

If you need to apply a global theme, you can use the THEME dictionary in the 
config, following the Ant Design theme structure. 

Let me know if you need a specific example for a certain chart type or plugin!


<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*

---
<sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/cfef74e9-4a92-4359-8a38-66a6985611b3?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/cfef74e9-4a92-4359-8a38-66a6985611b3?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/cfef74e9-4a92-4359-8a38-66a6985611b3?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/cfef74e9-4a92-4359-8a38-66a6985611b3?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/cfef74e9-4a92-4359-8a38-66a6985611b3?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/cfef74e9-4a92-4359-8a38-66a6985611b3?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/cfef74e9-4a92-4359-8a38-66a6985611b3?feedback_type=other)</sup>

[![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=To%20add%20a%20custom%20colour%20palette%20for%20charts%20in%20Superset%205.0.0%2C%20you%20can%20define%20your%20palette%20in%20the%20configuration%20file%20%28usually%20superset/config.py%29%20using%20the%20EXTRA_CATEGORICAL_COLOR_SCHEMES%20or%20EXTRA_SEQUENTIAL_COLOR_SCHEMES%20lists.%20For%20example%3A%0A%0A%60%60%60python%0AEXTRA_CATEGORICAL_COLOR_SCHEMES%20%3D%20%5B%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22id%22%3A%20%22myVisualizationColors%22%2C%0A%20%20%20%20%20%20%20%20%22description%22%3A%20%22My%20custom%20palette%22%2C%0A%20%20%20%20%20%20%20%20%22label%22%3A%20%22My%20Visualization%20Colors%22%2C%0A%20%20%20%20%20%20%20%20%22isDefault%22%3A%20True%2C%0A%20%20%20%20%20%20%20%20%22colors%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%
 
20%22%23006699%22%2C%20%22%23009DD9%22%2C%20%22%235AAA46%22%2C%20%22%2344AAAA%22%2C%20%22%23DDAA77%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%237799BB%22%2C%20%22%2388AA77%22%2C%20%22%23552288%22%2C%20%22%23CC7788%22%2C%20%22%23EEDD55%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%239977BB%22%2C%20%22%23BBAA44%22%2C%20%22%23DDCCDD%22%0A%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%7D%0A%5D%0A%60%60%60%0A%0AYou%20can%20do%20the%20same%20for%20sequential%20palettes%20with%20EXTRA_SEQUENTIAL_COLOR_SCHEMES.%20After%20updating%20the%20config%2C%20restart%20Superset%20for%20the%20changes%20to%20take%20effect.%20These%20palettes%20will%20then%20be%20available%20in%20the%20chart%20colour%20scheme%20selectors.%20More%20details%20and%20examples%20are%20in%20the%20config%20file%20comments%20%5B%22here%22%5D%28https%3A//github.com/apache/superset/blob/master/superset/config.py%29.%0A%0AFor%20ECharts-based%20visualizations%2C%20you%20can%20also%20apply%20chart-specific%20color%20overrides%20u
 
sing%20the%20echartsOptionsOverridesByChartType%20property%20in%20the%20theme%20configuration.%20This%20allows%20you%20to%20set%20colors%20and%20other%20visual%20properties%20for%20specific%20chart%20types%20%5B%22details%22%5D%28https%3A//github.com/apache/superset/pull/36389%29.%0A%0ASome%20plugins%20%28like%20CountryMap%29%20and%20certain%20charts%20support%20custom%20color%20scales%20via%20a%20JSON%20customization%20block%20in%20the%20Chart%20Options%20panel%2C%20and%20recent%20UI%20changes%20allow%20you%20to%20pick%20any%20valid%20CSS%20color%20using%20a%20color%20selector%20for%20supported%20charts%20%5B%22details%22%5D%28https%3A//github.com/apache/superset/pull/36732%29.%0A%0AIf%20you%20need%20to%20apply%20a%20global%20theme%2C%20you%20can%20use%20the%20THEME%20dictionary%20in%20the%20config%2C%20following%20the%20Ant%20Design%20theme%20structure.%20%0A%0ALet%20me%20know%20if%20you%20need%20a%20specific%20example%20for%20a%20certain%20chart%20type%20or%20plugin%21)&nbsp;[![J
 oin 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/37040)

GitHub link: 
https://github.com/apache/superset/discussions/37040#discussioncomment-15472101

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