Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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:   ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    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.