Skip to content

Commit

Permalink
Pass layout settings to the plot object
Browse files Browse the repository at this point in the history
In the original chartSeries that used S4 method, chart.layout is called to
setup layout and margins. Since now chartSeries is a wrapper for
chart_Series, it should be layout-free and only margins are applied.
  • Loading branch information
erichung0404 committed Aug 9, 2016
1 parent 7a18877 commit 29edf4d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions R/chartSeries.R
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,16 @@ function(x,
}
}
}
# Pass chart.layout settings
cs$Env$chart.layout <- chart.layout
if(!inherits(layout, "chart.layout")) {
cl <- chart.layout(length(cs$Env$ylim)-1)
} else
cl <- layout
# since xts::plot.xts is applied, chartSeries should now be layout free
# layout(cl$mat, cl$width, cl$height, respect=FALSE)
cs$Env$mar <- cl$par.list[[3]]$mar

assign(".xts_chob", cs, xts:::.plotxtsEnv)
if(plot) # draw the chart
cs
Expand Down

0 comments on commit 29edf4d

Please sign in to comment.