Skip to content

Commit

Permalink
Pass '...' through to chart.TimeSeries() functions (#183)
Browse files Browse the repository at this point in the history
* Pass '...' through to chart.TimeSeries.builtin()

This allows users to provide arguments to plot.xts() that aren't
explicit arguments to the chart.TimeSeries() functions.

For example, it allows users to remove the dates from the top right of
the plot:

   set.seed(21)
   returns <- xts(rnorm(100, 0, 0.005), .Date(1:100))
   chart.CumReturns(returns, main.timespan = FALSE)

This doesn't work with the current code.

* Add '...' to docs

Should have been included in previous commit.
  • Loading branch information
joshuaulrich authored Oct 24, 2023
1 parent 49a93f1 commit 3e46f41
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion R/chart.TimeSeries.base.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ chart.TimeSeries.base <-
grid.color=grid.color,
grid.lty=grid.lty,
xaxis.labels=xaxis.labels,
yaxis.pct=yaxis.pct)
yaxis.pct=yaxis.pct,
...)
return(p)
},
ggplot2 = {
Expand Down
6 changes: 4 additions & 2 deletions R/chart.TimeSeries.builtin.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ chart.TimeSeries.builtin <-
grid.color,
grid.lty,
xaxis.labels,
yaxis.pct){
yaxis.pct,
...){

y = checkData(R,method='xts')

Expand Down Expand Up @@ -100,7 +101,8 @@ chart.TimeSeries.builtin <-
yaxis.left = yaxis.left,
yaxis.right = yaxis.right,
grid.col = grid.color,
legend.loc = NULL)
legend.loc = NULL,
...)

if(!is.null(event.lines)) {

Expand Down
3 changes: 2 additions & 1 deletion man/chart.TimeSeries.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3e46f41

Please sign in to comment.