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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
SMG3397
Regular Visitor

Publishing Problems

The label positioning of report is changed.

       The parammeter direction="y" in R script visual doesn't seem to be working after publishing the report.

Although it works fine in Power BI desktop.

3 REPLIES 3
v-sihou-msft
Microsoft Employee
Microsoft Employee

@SMG3397

 

Can you share some screenshots and your R script?

 

Regards,

send2.PNGsend1.PNG

first image is screenshot of power bi desktop and second image is screenshot of power bi service.

The R script code is here:

library(ggplot2)
library(reshape2)
library(RColorBrewer)
library(ggrepel)
library(scales)
library(ggthemes)
 
set.seed(42)
getColors<-function(n){
   mypal<-colorRampPalette(brewer.pal(12, "Paired"))
   sample(mypal(n), n, replace=FALSE)
}
 
PropBarPlot<-function(df){
   melteddf<-melt(df, id=names(df)[1], na.rm=T)
   n<-length(levels(factor(melteddf$variable)))
 
   ggplot(melteddf, aes_string(x=names(df)[1])) + 
      geom_bar(data=melteddf,position="fill",stat="identity",width=0.06,aes(fill=variable,y=value))+
      labs(y="FAILURE",x="PRODUCT")+
      geom_text_repel(data=dataset,aes(label=dataLabel,x=Product,y=FinalFailure),direction="y",size=3.5,color="black",segment.size=0,check_overlap=TRUE,fontface="bold")+
      geom_point(data=dataset,aes(label=dataLabel,x=Product,y=FinalFailure),color="black")+
      scale_fill_manual(values=c("#FF0D00","#FF540A","#FFA600","#FFC100","#FFCB00","#FFDD00","#FFE200","#FFE900","#FFF100","#FFF300","#FDFF00","#FDFF00","#D9FF00","#A6FF00","#86FF00","#10FF00","#00FF43")) + 
      theme_classic(base_size=14)+
      guides(fill=FALSE)+
      coord_flip()+
      scale_y_continuous(limits=c(0,max(dataset$FinalFailure)),oob=rescale_none)
      
}
 
df <- data.frame(id=dataset$Product,
             val0=100,
             val1=1,
             val2=1, 
             val3=1, 
             val4=1, 
             val5=1, 
             val6=1, 
             val7=1,
             val8=1,
             val9=1,
             val10=5,
             val11=1,
             val12=1,
             val13=1,
             val14=1,
             val15=1,
             val16=1)
print(PropBarPlot(df))
 
Everything is working well in Power BI desktop but the overlapping text labels have been spread in Power BI online service. 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.