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 a9ccca5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions R/chartSeries.R
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,15 @@ function(x,
}
}
}
# Pass chart.layout settings
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 a9ccca5

Please sign in to comment.