Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

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 

 

1 Reply

  • Anonymous's avatar
    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