dygraph stepPlot: is there a direction option?

77 Views Asked by At

R dygraph with the stepPlot option displays steps in a style "horizontal, then vertical" (equivalent to direction = "hv" in ggplot2 geom_step). My data are the result of some aggregation, e.g. apply.monthly (ts, mean), which outputs the monthly means of a time series. The time stamp (index) of the resulting time series represents the endpoints of the time intervals (which makes sense). However, when plotting in dygraph, the steps go horizontal first, then up, displaying the monthly mean of the previous month. As a workaround, I shifted the time stamps using time(ts)= floor_date(time(ts),unit="month"), which corrects the plotting issue, but I feel this is not elegant, since it is a change of the time series and maybe other functions on the time series will be affected. And my data are not small enough to keep copies in different formats.

Did I miss an option in dygraph?

Thanks, Josef

0

There are 0 best solutions below