R Shiny - "€" Euro symbol not rendering in Shiny plots

201 Views Asked by At

I am attempting to label each of my data points in a Shiny App Plot with a € symbol and value.

I have succesfully created this plot using R, with the "€" sign appearing for each point 1 but when I try to render it in a shiny app, the "€" turns to "???" 2.

I have included screenshots of this plot when run using R and when run using the shiny app below. Does anyone know why this might be happening?

See the code used for creating the plot in the server/ui.

 ui <-
    
    dashboardPage(
        dashboardHeader(title = "Retail Dashboard"),
        dashboardSidebar(),
        dashboardBody(
                        fluidRow(                
                            box(title = "Sales", plotOutput("SalesPlot", height = "200px"), width = 14)
                               )
                      )
                 )

server <-

salesByWeek$SpendLabel <- paste0("€",
                                 formatC(salesByWeek$Spend, format="f", big.mark=",", digits=0))

shinyServer(function(input, output) {

  output$SalesPlot <- renderPlot({
    
    ggplot(salesByWeek,aes(x=weekno, y=Spend))+
      geom_line(color="green4",size=0.75)+
      geom_text(aes(label = SpendLabel), size=3,color="green4",
                hjust=0.5, vjust=-1.0)+
      ylim(0,max(salesByWeek$Spend)*1.05)
    
  })
  
})
0

There are 0 best solutions below