Forum Discussion
How to set default Padding = 0 and turn off Background in Visual Format (Power BI)?
- 1 year ago
Hi DavidAnthony ,
Thanks for reaching out to the Microsoft Fabric Community forum.
It seems you are trying to build a custom Power BI visual and wants to control the default formatting settings that appear in the visual’s format pane when it's first inserted into a report. Specifically, you are trying to set all padding values to 0 px and turn off the background by default.You are looking for a way to define these initial format defaults either through capabilities.json, visual.ts, or other config which is the right way, so the visual loads with their preferred formatting without the user needing to change it manually.
In order to achieve this you can go through the below documents:
About format pane and formatting model in Power BI custom visuals - Power BI | Microsoft LearnCapabilities and properties of Power BI visuals - Power BI | Microsoft Learn
Add formatting options to a Power BI custom visual - Power BI | Microsoft Learn
Customize the format pane in Power BI custom visuals - Power BI | Microsoft Learn
Thank you.
Hi DavidAnthony,
The main window owns the common visual container properties (everything in the 'General' menu) and cannot be accessed by the visual (either reading or writing). Custom visuals only have access to two properties under the general object: filter and formatString (which have specific use cases).
The only way to override these is to create a report JSON theme with the appropriate defaults.
If you want these available to custom visuals, I suggest making a feature request.
Regards,
Daniel