diff --git a/R/chart_Series.R b/R/chart_Series.R index e4afd14c..0a603035 100644 --- a/R/chart_Series.R +++ b/R/chart_Series.R @@ -522,10 +522,8 @@ add_TA <- function(x, order=NULL, on=NA, legend="auto", plot_object$add_frame(ylim=range(na.omit(xdata)),asp=1) # need to have a value set for ylim plot_object$next_frame() - # add grid lines, using custom function for MACD gridlines - lenv$grid_lines <- function(xdata,xsubset) { - pretty(xdata[xsubset]) - } + # add grid lines, using y_grid_lines function from replot_xts object + lenv$grid_lines <- plot_object$Env$y_grid_lines exp <- c(expression(segments(1,grid_lines(xdata,xsubset),NROW(xdata[xsubset]),grid_lines(xdata,xsubset), col=theme$grid)), exp, # NOTE 'exp' was defined earlier to be plot_macd # add axis labels/boxes