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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.