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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Timohven
Regular Visitor

interactive R graphics libraries does not work in PBI

I tried using dygraph and plotly , but they give me any error or graph.

I used this: https://radacad.com/interactive-map-using-r-and-power-bi-create-custom-visual-part-1

If the chart is made non-interactive, then everything works.

Screenshot 2023-03-24 202728.png

Help me please!

5 REPLIES 5
lbendlin
Super User
Super User

what's the error message?  Are you trying to plot to a non-standard output device?

I want to plot a simple interactive graph in power BI only.

I use:

rhtml template 

"pbiviz package" does not throw errors

in power BI I have no errors, but and the graph is not visible too

 

 

source('./r_files/flatten_HTML.r')

############### Library Declarations ###############
libraryRequireInstall("ggplot2");
libraryRequireInstall("plotly")
####################################################

################### Actual code ####################
qplot(`Petal.Length`, data = iris, fill = `Species`, main = Sys.time());
g = qplot(`Petal.Length`, data = iris, fill = `Species`, main = Sys.time());
####################################################

############# Create and save widget ###############
p = ggplotly(g);
internalSaveWidget(p, 'out.html');
####################################################

# ################ Reduce paddings ###################
ReadFullFileReplaceString('out.html', 'out.html', ',"padding":[0-9]*,', ',"padding":0,')
####################################################

You must plot to the default device

 

Create Power BI visuals using R - Power BI | Microsoft Learn

How can i do this? I just used the template example. It says in the reviews that it works without any changes. Thanks a lot

How can I do this? I just used the  "rhtml" template. It says in the reviews that it works without any changes. Thanks a lot

That would be a question for whoever wrote the reviews.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.