danielkrizian / rChartsDygraphs

An `rCharts` extension. Run `dygraphs` from R - interactive visualizations of time series using JavaScript and HTML canvas. See: http://dygraphs.com/ and
http://rcharts.io/
9 stars 10 forks source link

vertical zoom on multi-layout plot #24

Open jangorecki opened 10 years ago

jangorecki commented 10 years ago

Hi, When zooming in vertically on the multi-layout plot : http://rawgit.com/danielkrizian/rChartsDygraphs/master/examples/multi-layout.html, only the one of the layout is zoomed in. On horizontal zoom it is working for both of the layouts. Regards

danielkrizian commented 10 years ago

It is definitely possible and not too difficult to implement. The code is prepared to sync along y-axis too. It is just a matter of uncommenting this line:

https://github.com/danielkrizian/rChartsDygraphs/blob/master/R/Dygraph.R#L231

and exposing the c("none", "horizontal", "vertica", "both") options for the existing sync argument:

https://github.com/danielkrizian/rChartsDygraphs/blob/master/R/Dygraph.R#L61

As you can see, sync currently supports c(TRUE, FALSE) only, TRUE meaning horizontal syncing. Most use cases of working with multiple time series require sync along horizontal axis anyway, so we rushed to roll out the minimum feasible product.

If you wish to contribute, I'll make sure to merge the pull request.