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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Dailey
Frequent Visitor

Plotly in Power BI

Recently I learned that we can use plotly function of R in Power BI, which I think is awesome. The link is as follows:

https://github.com/Microsoft/PowerBI-visuals/blob/master/RVisualTutorial/CreateRHTML.md

 

However, it seems like the plot generated by plotly squeezes too much, as shown below. Any way to fix this?

q1.png

3 REPLIES 3
stevedep
Memorable Member
Memorable Member

You can take a look at this blog post. It describes how to add an interactive javascript Plotly Chart in Power BI. Its quite easy. 

You can tweak it to your liking. 

 

Kind regards,

 

Steve.

v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Dailey,

 

Please refer to below links:

Bar width in bar chart not changing

Customizing Individual Bar Widths

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 Hi Yuliana,

 

Thank you so much for the reply. I don't think it is the problem of R though.

 

I ran the code in RStudio and the plot generated was fine. However, when I imported this into the Power BI, the whole plot got squeezed. So I guess I should probably do something in Power BI.

 

Thank you and best regards,

Dailey

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.