Forum Discussion
Interactive R custom visuals not displaying in Power BI Desktop
I tried several online tutorials on how to begin creating interactive R custom visuals (such as the link shown below), and followed all these tutorials carefully.
http://radacad.com/interactive-map-using-r-and-power-bi-create-custom-visual-part-1
Every thing seemed to go as expected and according to the instructions, all the way to (apparently successfully) importing the packaged .pbiviz file as a custom visual into the set of available charts visible in the visualization pane of Power BI Desktop.
However, when I click on the newly available custom visual icon, only a generic empty chart tile is placed on the report page.
The same unssuccessful end result happens no matter which sample interactive R custom visual I tried, including the one from the sampleRHTMLVisual template, which I copied and pasted below the script.r file:
source('./r_files/flatten_HTML.r')
############### Library Declarations ###############
libraryRequireInstall("ggplot2");
libraryRequireInstall("plotly")
####################################################
################### Actual code ####################
g = qplot(`Petal.Length`, data = iris, fill = `Species`, main = Sys.time());
####################################################
############# Create and save widget ###############
p = ggplotly(g);
internalSaveWidget(p, 'out.html');
####################################################
I am fairly good with R; and have successfully implemented many R scripts to run within Power BI Desktop, and have also published them onto the Power BI Pro online service displaying static R visuals. However, I am a relative beginner with Power BI, and have not (yet) created any custom visuals. I'm excited about the ability to create interactive R custom visuals in Power BI.
- I installed the latest LTS version (8.12.0) of Node.js on my 64-bit Windows 10 Pro computer.
- Running 64-bit R 3.5.1 on this Windows 10 machine.
- All required R packages are installed.
Would appreciate assistance to overcome this hurdle.
Have you added data into the visual's Values as well? Even though it references a sample dataset and not the Power BI data, adding data to Values should trigger the visual to appear.
2 Replies
- deldersveldResident Rockstar
Have you added data into the visual's Values as well? Even though it references a sample dataset and not the Power BI data, adding data to Values should trigger the visual to appear.
- WingFrequent Visitor
It works now. Thanks for the hint. I'm off to the races making R-powered Interactive Custom Visuals !