I have the following code in server.R:
library(shiny)
library(plotly)
art.data <- read.csv("data1.csv", stringsAsFactors = FALSE)
shinyServer(function(input, output) {
output$distPlot <- renderPlotly({
col.str <- paste0(input$colspa, ".", input$rgbchoice, ".median")
p <- ggplot(art.data, aes(x = year, y = art.data[[col.str]], text = paste0(artist, "<br>", art))) + geom_point(size = 1) + xlab("Year") + stat_smooth(method = loess, se = FALSE)
ggplotly(p , tooltip = "text")
})
})
If I remove tooltip then the regression line is there in output graph but with tooltip included, regression line does not appear in the graph. Any solutions to have both the things together?
data1.csv
or some sample data to get a reproducible example. – Maximilian Peters