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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

R Visual stopped working.

A collegue of mine have developed a Custom R visual that consists if a facet plot. It has worked perfectly for some time now, both in desktop and on the web. It still works in desktop, but not on the web. The plot has dates on the x-axis that are displayed correctly in desktop but not on the web. Has there been some update recently causing this problem? How can the issue be solved?

 

FacetDesktop.png

FacetWebb.png

2 REPLIES 2
DavisBI
Solution Specialist
Solution Specialist

Hi, @Anonymous ,

 

What packages are your colleagues using? GGplot2 or just basic R?

 

Base on your description, this should be a problem with PowerBI Service itself (maybe caused by some updates recently), but it may be solved by changing the visual margins. You can show part of your R code here.

 

 

 

 

Anonymous
Not applicable

Thank you for your answear.

We tried to change the margins but it did not solve the problem.

 

The following packages are used: ggplot2, dplyr, plotly, tidyr, RColorBrewer, ggthemes, extrafontdb

 

Part of the facetplot code is provided below:

g<-ggplot(data = totalLong, aes(fill = eval(parse(text="Fill")), x = eval(parse(text=XName)), y = eval(parse(text="y")), text=paste0("Fill: ",Fill,"
","T: ",round(y,0),"
",XName,": ",eval(parse(text=XName))))) + geom_bar(stat="identity", position="stack",width = 1.2) + geom_segment(data = hlineData,aes(x=x,y=segY,xend=xe, yend=ye,fill=NULL,size=TotalLineSize,color=TotalColor,linetype=TotalLineType,text="")) + scale_size_identity() + scale_colour_identity() + scale_linetype_identity() + Theme + ylab(ylabel) + facet_grid(.~eval(parse(text=FacetName)), space = "free_x", scales = "free_x") + theme(strip.background = element_rect(fill = NA), panel.spacing = unit(0.5, "lines"), panel.grid.minor=element_blank(), panel.grid.major=element_blank(), axis.text.x = element_text(angle=90), axis.ticks.x=element_blank(), legend.title=element_blank(), axis.title.x =element_blank(), axis.title =element_text(size = titletextSize, colour = colLabel), axis.text = element_text(size = axisTextSize), legend.text=element_text(size=legendtextSize), panel.background = element_rect(fill="white"), text=element_text(family="Segoe UI"), strip.text.x = element_text(size = 14, family = "Segoe UI"), legend.position=LegendPosition) + paletteTheme + scale_x_discrete(expand=c(0,0)) + scale_y_continuous(limits=c(0,sumTotal+130), breaks=seq(0,sumTotal,100),expand=c(0,0)) p = ggplotly(g,tooltip="text") %>% config(displayModeBar = F) %>% layout(hoverlabel=list(bgcolor="white"))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors