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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

How remove space/padding around Power BI Custom R/plotly Visual

Hi! 

In the absence of a standard power bi component that can create an insight from two separate datasets showing one as a line graph and the other as a scatter, I had to create this myself. After some research I decided to use R and plotly. In the development I used RStudio and the component I made looked great there. Until I produced the Power BI component via pbivi / visual code. It showed that the graph was very small in relation to the area it received in the power bi report. A lot of free space above and to the left of the component was the result. Got a tip to use the ReadFullFileReplaceString, like

 

  # resolve bug in plotly (margin of 40 px)
  #ReadFullFileReplaceString('out.html', 'out.html', ',"padding":40,', ',"padding":0,')
  ReadFullFileReplaceString('out.html''out.html'',"padding":[0-9]*,'',"padding":0,')
 
but it didn't help too much. My boss is not happy with this visual and right now I don't know how to solve this. Are there any ways to improve this or are there other better ways to solve this using other techniques than plotly/R? The line chart is a disconnected dataset while the scatter has relationships in the data model. Is any of you has solve this or have better ideas, please let me know. Reference to articles or maybe you have code to share, please to so.
 
NB! If we could join the two datasets into one even though the first dataset is disconnected and the other has relationships in the datamodel. If we could create a custom calculated table that joins the two dataset (they both share x,y float values), and from this calculated table could create a line chart and scatters using standard visuals)
 
regards Geir 

 

problem R.png

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous,

AFAIK, current power bi does not provide the options to do custom with padding ranges. Perhaps you can submit to the idea forum to help improve R visual.
Regards,

Xiaoxin Sheng

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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