0

I am running this renderPlotly code in R shiny but for some reason the geom_point is working with the tooltips but not the geom_line:

output$Bulk_Weight_Plot <- renderPlotly({

  p <- ggplot(truck_chart_df(), aes(x = Forecast_Date, y = Bulk_Weight)) +
    geom_line() +
    geom_point() +
    xlab("Forecast Date") +
    ylab("Bulk Weight") +
    scale_color_ptol("cyl") +
    theme_minimal() +
    scale_y_continuous(labels = comma)
  p <- ggplotly(p)
  p

})

This is what it looks like in the app

enter image description here

Below is a snippet of the example data

enter image description here

Any advice or ideas would be much appreciated!

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
Chris
  • 33
  • 4
  • 4
    One possible issue might be that your `Forecast_Date` is a `character` instead of a proper date. To fix that you could try with explicitly setting the `group` aes, i.e. do `ggplot(..., aes(..., group = 1))`. For more help please provide [a minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) including a minimal working app code and a snippet of your data or some fake data. – stefan May 08 '23 at 09:16

0 Answers0