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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.