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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
FletchNZ
Frequent Visitor

Gauge Widget - Change gauge background colour (not widget Background)

Hey Guys,

This ones got me stumped, and ive spent far to much time on it.

 

I just want to change the background color of the gauge its self - the unfilled curve bit - not the widget background. I don't need any conditions or anything, I just need it a bit darker/different color.

 

There is no ability to change it in PBIDesktop but it can be changed via themes - I just cant find the right bit of JSON to do it, and i've been though around 15 themes. Some of the inbuilt themes change it but I cant find the source JSON to check it out.

 

I've also checked out other gauge widgets but this just looks better.

 

 

1 ACCEPTED SOLUTION
mwimberger
Resolver II
Resolver II

@FletchNZ 

 

Interesting problem - I thought I was the only one had a need to change that light grey colour. Decided I had to find out how to do this.

 

So a little digging showed it is the following line in the JSON theme file which adjusts that light grey colour which is usually set to #F3F2F1 :  "backgroundLight": "#F3F2F1"

 

This is documented here https://docs.microsoft.com/en-us/power-bi/desktop-report-themes  and do a kw search for backgroundLight.

 

I changed my theme file and was able to get the following result:

Jason Gauge Theme.jpgAfter using the following JSON:

 

{
"name": "Custom Theme",
"foreground": "#252423",
"foregroundNeutralSecondary": "#605E5C",
"foregroundNeutralTertiary": "#B3B0AD",
"background": "#FFFFFF",
"backgroundLight": "#EF89F8",
"backgroundNeutral": "#C8C6C4",
"tableAccent": "#118DFF"
}

 

There is a list of the JSON that drive the visuals here :https://github.com/deldersveld/PowerBI-ThemeTemplates but I have not yet resolved bringing the backgroundLight into the gauge JSON to only affect the background in the gauge visual. Not sure yet about that.

 

Hope that helps a little

 

Cheers

 

Manfred

View solution in original post

6 REPLIES 6
CH_MJR79
Helper II
Helper II

Found this thread as I've been looking to do the same thing with the gauge colour.

As @halfglassdarkly mentions you no longer have to edit the .json code now.

 

In Power BI desktop, if you go to View > Themes (dropdown) > Customize current theme, then on the Name and Colours section go to Advanced > the Gauge colour we are talking about (on mine at least) is the Third-level elements dropdown.

 

Change this to the colour of your choice and problem solved.

halfglassdarkly
Resolver IV
Resolver IV

I had exactly the same problem with the gauge visual recently.

You don't have to edit the json file manually btw, the relevant colour can be changed via the themes gallery now.

mwimberger
Resolver II
Resolver II

@FletchNZ 

 

Interesting problem - I thought I was the only one had a need to change that light grey colour. Decided I had to find out how to do this.

 

So a little digging showed it is the following line in the JSON theme file which adjusts that light grey colour which is usually set to #F3F2F1 :  "backgroundLight": "#F3F2F1"

 

This is documented here https://docs.microsoft.com/en-us/power-bi/desktop-report-themes  and do a kw search for backgroundLight.

 

I changed my theme file and was able to get the following result:

Jason Gauge Theme.jpgAfter using the following JSON:

 

{
"name": "Custom Theme",
"foreground": "#252423",
"foregroundNeutralSecondary": "#605E5C",
"foregroundNeutralTertiary": "#B3B0AD",
"background": "#FFFFFF",
"backgroundLight": "#EF89F8",
"backgroundNeutral": "#C8C6C4",
"tableAccent": "#118DFF"
}

 

There is a list of the JSON that drive the visuals here :https://github.com/deldersveld/PowerBI-ThemeTemplates but I have not yet resolved bringing the backgroundLight into the gauge JSON to only affect the background in the gauge visual. Not sure yet about that.

 

Hope that helps a little

 

Cheers

 

Manfred

Hi Manfred,
Did you manage to find a solution specific to only that visual?
Thanks,
David

Anonymous
Not applicable

Hi Manfred

 

when I add that JSON the color is not only changed in the gauge. It  changes everywhere. Is there a way to change only in the gauge? The dark colour is a request from our marketing, but the Filters are not readable like that. See below...

 

Cheers

Pat

 

pat_po_0-1632386807362.png

 

Awesome, Nice work!

I was completely focused on the specific gauge Json I never thought of a global variable.

Thank you so much

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.