Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ThePBIMaster
Advocate II
Advocate II

Setting defaultColors json property for Power BI Theme

Hi All,

 

I am creating a Power BI Theme using the templates described here: https://dataveld.com/2018/01/20/template-theme-files-for-power-bi-visuals/ along with the Enterprise DNA Power BI Themes Generator.

 

Here is an excerpt of the code used for the Line and clustered column visual (truncated):

 

"lineClusteredColumnComboChart": {
            "*": {
                            "general": [{
                                            "responsive": true
                            }],
                            "legend": [{
                                            "show": true,
                                            "position": "Top",
                                            "showTitle": true,
                                            "titleText": "",
                                            "labelColor": { "solid": { "color": "#01B8AA"}},
                                            "fontFamily": "Courier New",
                                            "fontSize": 10
                            }],
                            "dataPoint": [{
                                            "defaultColors": { "solid": { "color": "#448822"}}
                            }],          
                            "lineStyles": [{
                                            "shadeArea": true,
                                            "strokeWidth": 4,
                                            "strokeLineJoin": "bevel",
                                            "showMarker": true,
                                            "markerShape": "triangle",
                                            "markerSize": 3,
                                            "markerColor": { "solid": { "color": "#448822"}},
                            }]
                    }
            }

 

The problem I'm having is with the "defaultColors" property. There are multiple columns in a line and clustered column visual which I would like to be different, specific, fixed colours but there is only one "color" specified. What is the syntax for specifying other colours? (For example ""defaultColors": { "solid": { "color1": "#448822"}}, { "solid": { "color2": "#425762"}}, { "solid": { "color3": "#973476"}}} )

 

Notes:

1. There are no errors in the code and it is accepted into Power BI

2. I'm essentially having the same problem as described here - https://community.powerbi.com/t5/Desktop/Setting-multiple-colors-for-bars-in-Stacked-Bar-Chart-using...

 

0 REPLIES 0

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.