Difference of R-ggplot graph between PBI-Desktop a…

Hi, 

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

aQUER_0-1683621001317.png

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:

aQUER_1-1683621192596.png

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!

 

Read more here: Source link