dygraphs
dygraphs copied to clipboard
Synchronize multiple dygraphs on selection/highlight in Shiny?
Hi there,
In a shiny application using dygraphs is there any way to synchronize grouped dygraphOutputs on selection/highlight as well as zoom i.e http://dygraphs.com/gallery/#g/synchronize or http://www.highcharts.com/demo/synchronized-charts? Would this require including some custom javascript?
Thanks for the awesome package! Hope this query hasn't been raised before - couldn't find anything on the web. Hayden
Hello, I have exactly the same issue, did you eventually find out how to proceed? Thanks
No I haven't yet sorry, I was considering trying to use an observer function to look for the events ('drawCallback', 'highlightCallback', 'unhighlightCallback')
then update the other dygraphs using dyCallbacks()
. Or trying to figure out how to make an html widget for this synchronize function; synchronizer.js.
I'll let you know if I get something working
You can make a call to the dygraph
function in the renderDygraph
call in order to set the group
parameter like this :
library(shiny)
library(dygraphs)
ui <- fluidPage(
sidebarLayout(
sidebarPanel(),
mainPanel(dygraphOutput("dyPlot1"),
dygraphOutput("dyPlot2"))
)
)
server <- function(input, output) {
output$dyPlot1 <- renderDygraph({
dygraph(ldeaths, main = "All", group = "lung-deaths")
})
output$dyPlot2 <- renderDygraph({
dygraph(mdeaths, main = "All", group = "lung-deaths")
})
}
shiny::runApp(list(ui = ui, server = server))
Thanks for your feedback, I have been using this functionality as described in the dygraphs documentation.
The question was whether we can build on this group zooming synchronisation to also synchronise the selection highlighting.
Compare the output from your code example to my original example links to see the selection synchronisation.
My bad I didn't realize your point was mainly about the highlighting. I'll have a look at this when I have some time.
Hello,
has anybody resolved this issue yet? I'm as well looking for this feature not only to synchronize the plots zoom wise but also on selection.
Hi,
I'm having the same issue, has someone been able to solve it?
Me too, I'm having the same issue.
any solution so far?
any solution?
Unfortunately it is been a long time since R dygraphs has any update. I hope this project doesn't die because it is an important package with great potential additions.