简体   繁体   中英

R shiny r-markdown: synchronize zoom in charts

I am creating a flexdashboard with R markdown / shiny.

Assumed the dashboard has two identical scatter plots. Is there a way to synchronize the two charts, if I zoom into one of them? Which is the best package to achieve this and to have it on the flexdashboard?

I tried Plotly. But there I could only synchronize one axis, but not both at the same time. If the charts are vertically oriented it would synchronize the x axis, and if horizontally oriented it would synchronize the y axis.

I am still trying dygraph. I have the impression by grouping the charts, I might be able to synchronize the zoom. Is that right? Would it synchronize both axis at the same time? (Only problem, this is mainly a time series tool, and not meant for scatter plots, ie not for data with more than one value per x value. At least this is my impression.)

Is there a package able to handle x and y axis synchronization at the same time? Or did I miss anything with Plotly/dygraph?

Thanks for your help.

For those interested. Rbokeh does scatterplots and allows synchronizing both axes. Use the grid_plot function to plot your charts and set same_axes = TRUE.

dygraphs synchronizes only the date range (x axis), if you set the parameter group . To synchronize the y axis you can try to get the zoom callback and to apply the zoom level to the other plot.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM