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
Anonymous
Not applicable

Set shape color in Theme .json

Hi community,

I'm in the process of building a PBI template for a customer. I've got an issue with the standard fill of shapes that I can't seem to get working. Here's the code that I'm using:

 

 

{
	"name": "ShapeTemplate",
	"visualStyles": {
		"shape": {
			"*": {
				
				"fill": [{
					"show": true,
					"fillColor": { "solid": { "color": "#FFFFFF"}},
					"transparency": 0
				}],
				"visualHeader": [{
					"show": false
				}]
			}
		},
		"page": {
			"*": {
				"background": [
					{
						"color": {
							"solid": {
								"color": "#CCCCCC"
							}
						},
						"transparency": 100
					}
				],
				"outspace": [
					{
						"color": {
							"solid": {
								"color": "#CCCCCC"
							}
						},
						"transparency": 0
					}
				]
			}
		}
	}
}

 

 

 

I've am able to show/hide the fill using the code above, but it seems like the 'fillColor' parameter does not work for me. Has anyone of you been able to get the fill color working in their templates? If so then I'm curious how you all did it.

 

kind regards

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try this code and test whether it will work.

For referenec: https://github.com/deldersveld/PowerBI-ThemeTemplates/blob/master/Shape.json

{
	"name": "ShapeTemplate",
	"visualStyles": {
		"basicShape": {
			"*": {
				"line": [{
					"lineColor": { "solid": { "color": "#01B8AA"}},
					"transparency": 0,
					"weight": 3,
					"roundEdge": 0
				}],
				"fill": [{
					"show": true,
					"fillColor": { "solid": { "color": "#DDDDDD"}},
					"transparency": 0
				}],
				"rotation": [{
					"angle": 0
				}],
				"visualHeader": [{
					"show": false
				}]
			}
		}
	}
}

And you can check the official document about power bi themes.  It listed all the properties: (notice: some of the properties can be confited but they not really enabeld to settings since power bi did not release them to GA for theme usage)

Use report themes in Power BI Desktop - Power BI | Microsoft Docs

 

Best Regards,
Rico Zhou

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

3 REPLIES 3
v-rzhou-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try this code and test whether it will work.

For referenec: https://github.com/deldersveld/PowerBI-ThemeTemplates/blob/master/Shape.json

{
	"name": "ShapeTemplate",
	"visualStyles": {
		"basicShape": {
			"*": {
				"line": [{
					"lineColor": { "solid": { "color": "#01B8AA"}},
					"transparency": 0,
					"weight": 3,
					"roundEdge": 0
				}],
				"fill": [{
					"show": true,
					"fillColor": { "solid": { "color": "#DDDDDD"}},
					"transparency": 0
				}],
				"rotation": [{
					"angle": 0
				}],
				"visualHeader": [{
					"show": false
				}]
			}
		}
	}
}

And you can check the official document about power bi themes.  It listed all the properties: (notice: some of the properties can be confited but they not really enabeld to settings since power bi did not release them to GA for theme usage)

Use report themes in Power BI Desktop - Power BI | Microsoft Docs

 

Best Regards,
Rico Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello,

 

Did some ever achieved to set shape border / background with theme ? I tried several things found on differents pages with no success.

It seems to be broken.

After lots of research I finally found a working JSON for shape https://community.powerbi.com/t5/Report-Server/New-Shapes-in-PBI-How-to-Setup-JSON/m-p/1880186

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.