Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

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-json/m-p/1173556#M529120

 

No Replies