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
NenadV
Helper III
Helper III

Setting multiple colors for bars in Stacked Bar Chart using json theme

I am trying to set multiple colors for stacked bar chart, something like this:Untitled.png

but using json theme. And now I have problem, because I can not set this, altough my json file is in right format, all other properties are set successfully, only this is not working. I tried naming property defaultColor, defaultColors, color,colors, dataColor, dataColors, but nothing is working.

Here is my json file: 

{
    "name":"MyTheme",
    "visualStyles":{
       "barChart":{
          "*": {
             "labels": [{
                "show": true,
                "color": { "solid": { "color": "#e044a7"}},
                "labelDisplayUnits": 1,
                "labelPrecision": 0,
                "fontFamily": "Calibri",
                "fontSize": 11,
                "labelPosition": "OutsideEnd"
             }],
             "dataPoint":[{
                "defaultColors": [{ "solid": { "color": "#1A355E"}},{ "solid": { "color": "#000000"}},{ "solid": { "color": "#ffffff"}}]
             }]
          }
       }
    }
}

 

3 REPLIES 3
amitchandak
Super User
Super User

@amitchandak , this theme generator does not help, using it I can only set multiple colors on whole report level, but not on stacked bar chart level.

Hi @NenadV,

 

I've just come across a similar problem but for the Line and clustered column visual. Did you find a solution for the json property defaultcolors?

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.