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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

New Shapes in PBI - How to Setup JSON?

Hi There,

with the may 2021 release of PBIRS we also got the new shapes feature with desktop which was released to the regular desktop in april 2021 (https://powerbi.microsoft.com/de-de/blog/power-bi-april-2021-feature-summary/#post-14480-_Toc6868909...).

 

Unfortunately after converting existing shapes my settings in my custom json don't work properly anymore.

 

Is there any updated documentation to this?

 

This (https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-report-themes#report-theme-json-fil...) does not help at all...

 

Cheers

Axel

8 REPLIES 8
joshuakellyrha
Frequent Visitor

Hi Axel Et al,

 

The element name for 'new' shapes (new from April 2021) is now just "shape" instead of "basicShape". Curiously, it also shares a similar structure with actionButton (you have to declare the default state for the shape).

 

I found a recently updated Git Repo which has some useful info these new shapes:

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

 

Please see the below json, hope this helps!

 

 

{
  "name": "ShapeFillAndOutline",
  "visualStyles": {
    "shape": {
      "*": {
        "background": [
          {
            "show": false
          }
        ],
        "fill": [
          {
            "show": true
          },
          {
            "$id": "default",
            "transparency": 0,
            "fillColor": {
              "solid": {
                "color": "#FFFFFF"
              }
            }
          },
          {
            "$id": "hover",
            "transparency": 0,
            "fillColor": {
              "solid": {
                "color": "#000000"
              }
            }
          }
        ],
        "outline": [
          {
            "show": true
          },
          {
            "$id": "default",
            "transparency": 0,
            "lineColor": {
              "solid": {
                "color": "#000000"
              }
            }
          }
        ],
        "visualHeader": [
          {
            "show": false
          }
        ]
      }
    }
  }
}

 

 

Hello Joshua,

 

Thank you for your answer. In fact, this helped me apply the settings to the shapes as I wanted.

However, I would like to apply different settings for different shaps (lines, rectangles, oval, etc.).

Do you know if there is any way to define it? Our is there no possibility to select the type of shape that I want to apply settings?

 

Regards

HannahFondOf
New Member

I had the same problem and created an issue here. Feel free to upvote it: (1) Fix shape formatting in theme json - Microsoft Power BI Community

Anonymous
Not applicable

Hi Dedmon,

this works after converting the shape. But that's not the point. This is my current JSON (partly):

"basicShape": {
			"*": {
				"background": [{
					"show": false,
                    "color": { "solid": { "color": "#ffffff" } },
                    "transparency": 20
                }],
				"line": [{
					"lineColor": { "solid": { "color": "#323232"}},
					"transparency": 0,
					"weight": 3,
					"roundEdge": 0
				}],
				"fill": [{
					"show": false,
					"fillColor": { "solid": { "color": "#ffffff"}},
					"transparency": 100
				}],
				"title": [{
					"show": false,
				    "fontColor": { "solid": { "color": "#323232" } },
				    "background": { "solid": { "color": "#ffffff" } },
				    "alignment": "Left",
				    "fontSize": 11,
				    "fontFamily": "Segoe UI Light"
				}],
				"rotation": [{
					"angle": 0
				}],
				"visualHeader": [{
					"show": false
				}],
				"border":[{
					"show":true,
					"color": { "solid": { "color":"#CCCCCC" } },
					"radius": 5
				}]
			}
		}

Now the code from above does not have any affect. I guess with the new shapes something else needs to change...


Cheers

Axel

Hi @Anonymous ,

 

It seems that something wrong with the custom shape by json file. I tried it also in the latest verison of power bi desktop cloud version, it didn't work also. 

 

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

 

Best Regards,

Dedmon Dai

Anonymous
Not applicable

Hi Dedmon,

my version is an extended version of this:

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
				}]
			}
		}
	}
}

Of course, my code was only a part of a much larger JSON file... I assumed you would anticipate that. Sorry.

 

Anyway: If we focus on the fill attribute the new shapes do not recognize the setting given in the JSON file. So my question is: were there any fundamental changes to how to setup the JSON file regarding the new shapes and if so, where is the documentation?

 

Thanks in advance

Axel

Hi @Anonymous ,

 

Yes, I test it with the code provide in github yesterday, it didn't work even in the latest version of power bi desktop cloud version. Unfortunately, I didn't find any document that talking about setting up json for the new shape. I suggest you raise a support ticket for it. Go to https://support.powerbi.com. Scroll down and click "CREATE SUPPORT TICKET".

 

Best Regards,

Dedmon Dai

v-deddai1-msft
Community Support
Community Support

Hi @Anonymous ,

 

Would you please try to change the color for the shapes manually?

Capture5.PNG

 

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

 

Best Regards,

Dedmon Dai

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.