Hello all,
I'm using dygraph on a Shiny App.
I want the user add dynamically an annotation on a plotted line when he clicks on it.
I also want him able to edit this annotation.
I spent a lot of time trying but I can't find a way to do it in a ShinyApp. Could you help me ?
Here a basic application involving a dygraph
library(shiny)
library(dygraphs)
X <- c(1,2,3,4,5,6,7,8,9,10)
Y<-c(100,200,250,267,234,88,78,90,15,32)
data <- data.frame(X,Y)
ui <- fluidPage(
titlePanel("Test"),
sidebarLayout(
sidebarPanel(
),
mainPanel(
dygraphOutput("plot")
)
)
)
server <- function(input, output) {
output$plot <- renderDygraph({
p <- dygraph(data)%>% dyRangeSelector()
})
}
shinyApp(ui = ui, server = server)`
I feel the answer is somewhere around dyAnnotation()
or dyCallbacks with a pointClickCallback =
but I can't managed it with JS code.
If someone know how to solve it with another library (like plotly) feel free to tell me how.
Thanks a lot in advance