Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi everyone,
I'm currently developing a custom visual for Power BI, and I want to configure the default settings for the visual when it's added to a report.
Specifically, I want to:
Set the default Padding (under format > general > padding) to 0 px on all sides.
Set the default Background (under format > effects > background) to Off by default.
I’m looking for a way to override the default format panel values when the visual is first inserted.
Is there a way to control these defaults in a custom visual?
Any guidance or example on how to set these initial values (via capabilities.json, visual.ts, or other metadata) would be greatly appreciated.
I've attached screenshots of the settings I'm trying to control.
Thanks in advance!
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
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
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 Learn
Capabilities 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 ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.
Thank you.
Hi @DavidAnthony ,
I wanted to follow up and see if you had a chance to review the information shared. If you have any further questions or need additional assistance, feel free to reach out.
Thank you.
User | Count |
---|---|
8 | |
7 | |
2 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |