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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

JSON dataColors on barChart, is it possible?

Good afternoon,

 

I've been for two weeks searching a way to apply different dataColors on JSON on some visuals, as can be on barChart or other visuals where you can apply dataColors at the time of its creation.

 

Is it possible?

 

Thank you in advance

 

5 REPLIES 5
lbendlin
Super User
Super User

my understanding is that you cannot swap individual colors. You have to swap the entire theme.

It's a one-way street. I don't think you can write back from Power BI Desktop into the theme file. Nice idea though!

lbendlin
Super User
Super User

Anonymous
Not applicable

More or less,

 

I've created a JSON, I'll just attach you one chart of the visuals to explain what I'm looking for:

"pieChart":

        {"*":

            {"legend":

                [

                    { "show": false}

                ],

                "labels":

                [{

                        "show": true,

                        "labelStyle": "Category",

                        "color":

                        {"solid":

                            {"color": "#616161"}

                        },

                        "labelDisplayUnits": "Auto",

                        "fontSize": 8.1,

                        "fontFamily": "Arial",

                        "position": "outside"

                    }],

                "title":

                [{

                        "show": true,

                        "wordWrap": true,

                        "fontColor":

                        {"solid":

                            {"color": "#000000"}

                        },

                        "background":

                        {"solid":

                            {"color": "#FFFFFF"}

                        },

                        "alignment": "Left",

                        "fontSize": 10.5,

                        "fontFamily": "Arial Black"

                    }

                ]

            }

        }

 

What I need is to include here some colors that are differents from the ones define previously. That's something you can do manually on Desktop, but I would like to include it on the JSON file.

 

 

lbendlin
Super User
Super User

Conditional Formatting accepts colors as field values, either clear text ("green") or in RGB ("#00FF00").  Not sure what you mean by "dataColors on JSON"?

Anonymous
Not applicable

Hey Idendlin,

 

As you might know, you can define styles on a JSON and import it on Power BI to affect on visualitzacions.

 

In some visuals, as can be barChart, lineChart, etc. you have the possibility of change the colors but semestre that on JSON file, its not possible to define it easily. Do you have any idea on how to do it?

 

Thank you in advance!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.