quantmod icon indicating copy to clipboard operation
quantmod copied to clipboard

Refactor chart_Series() function to use xts::plot.xts

Open erichung0404 opened this issue 8 years ago • 0 comments

Since chart_Series() function is now a wrapper for xts::plot.xts, there is no need to call new.replot() to recreate the framework that is closer to plot.xts. The main change is matching the parameters created by chart_theme() function with the new plot object created by plot.xts. Besides, as chartSeries() function is now the wrapper for chart_Series(), multi.col argument of chartSeries() that doesn't share with chart_Series() is handled in range.bars to have multiple bar and border colors.

In zoom_Chart() function, when plot_object$subset() function is called it throws an error: 'x' and 'y' lengths differ and creates wrong chart. The first problem is in xts:::chart.lines which calls lines() function to draw lines but the value for x doesn't change with the subset value of y. So a new chart.lines() function is given and passed to the .plotxtsEnv environment. The other problem is that y limit value doesn't change after subsetting so it is reset whenever subset period is specified.

erichung0404 avatar Aug 04 '16 11:08 erichung0404