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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.