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 default visual viewport size in custom visual

Is there a way to set the defaul viewport size when start a custom visual?  Thanks.

1 ACCEPTED SOLUTION
dm-p
Super User
Super User

Hi there,

It's currently not possible, but has been accepted onto the backlog. I'd suggest adding a vote to the idea and watching it for progress.

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




View solution in original post

6 REPLIES 6
taghos
Employee
Employee

Just wondering, if there has been an update on the same?

I want to set a fixed width and height by default for a custom visual I am developing. Currently in I try to do options.viewport.width=800 in say Visual's constructor or update method, it's not respecting it.

Hi @taghos - there have been no new features added to the SDK for 9-10 months, so this is still not possible. The only manipulation of the viewport in the SDK is to maximise it to full screen mode by using switchFocusModeState on the visual host object.

Your best bet is to contact the custom visuals team - pbicvsupport@microsoft.com - if you need a direct answer.

Regards,

Daniel

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Yes, I followed up with pbicvsupport@microsoft.com team and they confirmed that the viewport properties like width and height could not be set as of now.

Also, I have another related question -> Although we can't set the viewport properties but at any point we can get and read the values(width & height) as described here: https://microsoft.github.io/PowerBI-visuals/tutorials/building-react-based-custom-visual/receiving-p.... Just wanted to check if there is any variable corresponding to the transparency under Background? I just want to get the transparency value in % or fraction of the current window.

This is probably another question to the team to confirm. I suspect that we can't do this - advice I have been provided previously is that standard properties are not accessible through the SDK, unless exposed to the host services.

I just tested and inspected checked the host.colorPalette object in my constructor and this doesn't correspond to the value I set in my visual properties, so I presume this pulls from the report theme.

I also checked to see if the sandbox has anything passed through as part of its CSS from the parent window, but this appears to be set far above the iframe sandbox in the DOM in a div with a class of themableBackgroundColor, meaning that the style is several levels higher and therefore inaccessible.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




dm-p
Super User
Super User

Hi there,

It's currently not possible, but has been accepted onto the backlog. I'd suggest adding a vote to the idea and watching it for progress.

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Anyone know if there has been any movement on this?  Looks like the idea was accepted a year ago.

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.