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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Solle
Helper III
Helper III

SVG image position

Hi All, 

I have an issue related to my SVG imported icon - I have the below code and I am showing the SVG by using the HTML viewer add-in, in PowerBI. 

 

 

SVG = "<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' id='Capa_1' x='20px' y='20px' viewBox='0 0 512 512' style='enable-background:new 0 0 512 512;' xml:space='preserve' width='40' height='40'>
<g>
	<path d='M480,224H32c-17.673,0-32,14.327-32,32s14.327,32,32,32h448c17.673,0,32-14.327,32-32S497.673,224,480,224z'/>
	<path d='M32,138.667h448c17.673,0,32-14.327,32-32s-14.327-32-32-32H32c-17.673,0-32,14.327-32,32S14.327,138.667,32,138.667z'/>
	<path d='M480,373.333H32c-17.673,0-32,14.327-32,32s14.327,32,32,32h448c17.673,0,32-14.327,32-32S497.673,373.333,480,373.333z'/>
</g>


</svg>"

 


The issue is that the SVG contains some blank spaces below the actual image, meaning that when i want to downsize the image, a scrollable bar shows up (see images below). 

Solle_0-1651041056040.png

Does anyone know how to solve this?

Best Regards, 
Solle

1 ACCEPTED SOLUTION
dm-p
Super User
Super User

Hi @Solle,

The container used to host any custom visual has a small amount of padding that we don't have access to, as it sits above the main body of the visual in the DOM.

If it's he HTML Content visual you're using, it applies a generic scroller over the content, which is pushing the height over in this case. It may be easier to just keep the container size a little bigger, but you can style out the scrollbar handle in this case using the measure-based stylesheet property and assigning via conditional formatting, but it still may scroll if the user clicks on the visual and uses their mouse wheel. 

Note that the property is broken in the new-style formatting pane and you will need to revert to the old version to access. This is an issue for all custom visuals utilising conditional formatting in this manner and Microsoft should be deploying a fix in the next major version of Power BI Desktop.

The measure you can create for the CSS is as follows:

 

CSS = ".os-scrollbar {
    visibility: hidden;
}"

 

Assign this via the property and the scrollbar handle will no longer display, e.g.:

dmp_0-1651543124464.png

Regards,

Daniel





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

Proud to be a Super User!


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




View solution in original post

2 REPLIES 2
dm-p
Super User
Super User

Hi @Solle,

The container used to host any custom visual has a small amount of padding that we don't have access to, as it sits above the main body of the visual in the DOM.

If it's he HTML Content visual you're using, it applies a generic scroller over the content, which is pushing the height over in this case. It may be easier to just keep the container size a little bigger, but you can style out the scrollbar handle in this case using the measure-based stylesheet property and assigning via conditional formatting, but it still may scroll if the user clicks on the visual and uses their mouse wheel. 

Note that the property is broken in the new-style formatting pane and you will need to revert to the old version to access. This is an issue for all custom visuals utilising conditional formatting in this manner and Microsoft should be deploying a fix in the next major version of Power BI Desktop.

The measure you can create for the CSS is as follows:

 

CSS = ".os-scrollbar {
    visibility: hidden;
}"

 

Assign this via the property and the scrollbar handle will no longer display, e.g.:

dmp_0-1651543124464.png

Regards,

Daniel





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

Proud to be a Super User!


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




Anonymous
Not applicable

Hi @Solle ,

Base on my research, there is no proper setting to disable the scroll bar. yingyinr_0-1651478212865.pngYou can contact custom visual support team to get professional help, change the settings of HTMLViewer in the backend similar as in the following codes. Or you can raise a new idea and add your comments there to make this feature coming sooner.

Power BI Custom Visuals' Community

make custom visuals scrollable

  constructor(options: VisualConstructorOptions) {
			options.element.style.overflow = 'auto';

Best Regards

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.