Forum Discussion
R visual - responsive visualization in power BI
- 8 years ago
Hi, thanks for your help reporting this bug.
There was a bug fix a little while ago that appears to have unintentionally led to this regression. We already know the fix, it is currently in the pipe to be deployed to general production next week, around 7/13.
In the meantime if this is causing issues, there is a workaround. You can add the following lines to the beginning of your R script:
if (exists("powerbi_rFontName")){library("showtext")
showtext.opts(dpi = powerbi_rPngDeviceDpi)
showtext.auto()
}
This should make the text appear normal size in service without affecting desktop behavior, and should not cause any issues in service once the fix is deployed.
Same here - and pretty sure it wasn't an issue a month ago when I last looked. Now my R visual looks fine on desktop, but once uploaded to the Service the font looks very small, despite whatever changes I make to the font within the plot / theme etc
Are there certain R packages that are not available on the Power BI Service perhaps? Surely not the problem here as I'm only using dplyr, ggplot2 and tidyr. Screenshots below - Desktop first, then same visual once published. Code below that.
Desktop
ggplot() +
geom_bar(data=ot1, aes(x = att, y=count,fill=score), stat="identity", position = "stack") +
geom_bar(data=ot2, aes(x = att, y=count,fill=score), stat="identity", position = "stack") +
geom_text(data =labeldata, aes(x=att,y=y, label = count), size=6, colour = "black") +
coord_flip() +
scale_x_discrete(limits= rev(levels(ot1$att)))+
theme_minimal() +
scale_fill_manual(values = c("#d7191c","#fdae61","#ffffbf","#abdda4","#2b83ba"))+
xlab("Attribute")+
ylab("Count of Beneficiaries") +
ggtitle(paste("Initial Stars By Attribute (n=",totalDS, ")", sep='')) +
theme(axis.text.x=element_blank()) +
theme(plot.title=element_text(size=2
Help!
Thanks
Pete.
Similar to your script, I have used the coord_flip() function. My visual works perfect when my plot is vertical. When I use the coord_flip() to rotate my visual, the plot rotates but the rendering looks weird. Any idea?
- Anonymous7 years agoNot applicable
My problem was just the label font being too small once published, which the suggested fix sorted out. Hard to say based on "rendering looks weird" but sounds like you have some other problem not related to the one raised here.