cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
johanjsc
Frequent Visitor

Json Theme - Enable background for gauge by default

Hi!

 

Tried to read and understand this from the extensive site here: https://docs.microsoft.com/en-us/power-bi/desktop-report-themes

But my programming knowledge is a bit to low, and i struggle to find out how to set Background=True on my Gauge meters.

The color and transparency works, but by default the On/Off switch for the Background is still Off. Please advise what i need to add in my json file to make my gauges automatically swith Background = On

 

{
"name":"PowerBI Demo",
"dataColors":["#003366", "#A8C5E0", "#214F80", "#A4D3E3", "#82A1BD", "#366996", "#304E64", "#004576", "#666666", "#000000", "#0C304A", "#0076DE"],
"background":"#FFFFFF",
"foreground":"#003366",
"tableAccent":"#214F80",

"visualStyles":
{
"page": {
"*": {
"background": [
{
"color": {
"solid": {
"color": "#ebeef2"
}
},
"transparency": 0
}]
}
},
"gauge":{
"*":{
"background":[{
"color":{
"solid":{
"color":"#ffffff"
}
},
"transparency": 0
}
]
}
}
}
}

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Json Theme - Enable background for gauge by default

Hi @johanjsc ,

 

I found a solution in the end of this post. we can use the following json to meet your requirement. Notice the blue part that control the show status of visual.

 

{
"name":"PowerBI Demo",
"dataColors":["#003366", "#A8C5E0", "#214F80", "#A4D3E3", "#82A1BD", "#366996", "#304E64", "#004576", "#666666", "#000000", "#0C304A", "#0076DE"],
"background":"#000000",
"foreground":"#003366",
"tableAccent":"#214F80",
"visualStyles": {
	"gauge": {
		"*": {
                "background": [{
		    "show": {
                        "expr": {
                            "Literal": {
                                "Value": "true"
                            }
                        }
                    },
                "color": { "solid": { "color": "#FF0000" } },
                "transparency": 25
            }]
		}
	},
    "page": {
            "*": {
                "background": [{
                "color": { "solid": { "color": "#FFFFFF" } },
                "transparency": 25
            }],
            "outspace": [{
                "color": { "solid": { "color": "#004753" } },
                "transparency": 0
            }]
        }
    }
    }
}

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support
Community Support

Re: Json Theme - Enable background for gauge by default

Hi @johanjsc ,

 

I found a solution in the end of this post. we can use the following json to meet your requirement. Notice the blue part that control the show status of visual.

 

{
"name":"PowerBI Demo",
"dataColors":["#003366", "#A8C5E0", "#214F80", "#A4D3E3", "#82A1BD", "#366996", "#304E64", "#004576", "#666666", "#000000", "#0C304A", "#0076DE"],
"background":"#000000",
"foreground":"#003366",
"tableAccent":"#214F80",
"visualStyles": {
	"gauge": {
		"*": {
                "background": [{
		    "show": {
                        "expr": {
                            "Literal": {
                                "Value": "true"
                            }
                        }
                    },
                "color": { "solid": { "color": "#FF0000" } },
                "transparency": 25
            }]
		}
	},
    "page": {
            "*": {
                "background": [{
                "color": { "solid": { "color": "#FFFFFF" } },
                "transparency": 25
            }],
            "outspace": [{
                "color": { "solid": { "color": "#004753" } },
                "transparency": 0
            }]
        }
    }
    }
}

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
johanjsc
Frequent Visitor

Re: Json Theme - Enable background for gauge by default

Exactly what I was looking for - many thanks for quick and good reply!

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors