Forum Discussion

aQUER's avatar
aQUER
New Member
3 years ago

Difference of R-ggplot graph between PBI-Desktop and PBI-Service

Hi, 

I've done a R visual that its working perfect in desktop:

with this sentence:

ibrary(ggplot2)
library(reshape2)
dataset$rowid=seq(1,nrow(dataset))
dataset$DATA_FI=ifelse(is.na(dataset$DATA_FI), max(dataset$DATA_INI, na.rm=T), dataset$DATA_FI)
CronoM <- melt(dataset, measure.vars = c("DATA_INI", "DATA_FI"))
CronoM$data<-as.Date(CronoM$value)
CronoM= CronoM[order(CronoM$value),]

Dades=CronoM
 ggplot(Dades,
   aes(x = data, y = as.factor(SERVEI),colour = factor(DESCRIPCIO), group = rowid)) + # add group aesthetic
   geom_line(linewidth = 20) +
   labs(title = paste0 (Dades$NUM_EXPE[1],"\n" ,Dades$TITOL, "\n" ,Dades$NOM_PROCES),x = NULL, y = NULL) +
   theme_minimal()+
    theme(legend.position = "bottom",legend.title=element_blank(),    axis.text.y=element_text(size=12))
 
but when I published to service the graph has no lines:

I found a post from years ago with similar trouble (same title) and I added the sentences they found that fixed the problem:

if (exists("powerbi_rFontName")){
  library("showtext")
  showtext.opts(dpi = powerbi_rPngDeviceDpi)
  showtext.auto()
}
 
but that not's working for me...
It's my first time doing R visuals in PowerBi... any help will be appreciated!
thanks!
 

1 Reply

  • any idea?

    I changed geom_line by geom_points and they are visible...

    Why I can't see lines? any suggestion?

     

    many thanks