PerformanceAnalytics icon indicating copy to clipboard operation
PerformanceAnalytics copied to clipboard

Refactor chart.TimeSeries to use plot.xts

Open erichung0404 opened this issue 8 years ago • 2 comments

As all the time series charting functions in PerformanceAnalytics share with chart.TimeSeries, we should refactor it with plot.xts first and keep reviewing it to coordinate with other functions. Retain the log transformation feature and add dynamic graph extension using dygraphs package.

erichung0404 avatar May 17 '16 09:05 erichung0404

I don't think that we should work on dynamic graphs until all the core functionality has been implemented. When we do begin work on html charting frameworks, we have to decide on what approach we should use.

  1. integrate frameworks directly into the core functions
  2. write wrapper functions for html charting frameworks (e.g. dygraphs) that operate on objects that are invisibly returned from the core charting functions.
  3. other

Integrating html charting frameworks should discussed in a separate ticket

rossb34 avatar May 17 '16 15:05 rossb34

Understood. I think I paid too much attention on html charting. Then, for the core functionality, we can add the features chart.TimeSeries doesn't have but plot.xts does such as multi.panel, up.col/dn.col and some arguments regarding grid.

multi.panel Allows users to plot on multiple panels and arrange the layout themselves, layout(matrix(1:2, nrow = 1, ncol = 2)), for example. We can set it to FALSE in chart.TimeSeries as multiple charts are used in charts.TimeSeries. So I think we should not discuss multiple charts here.

up.col/dn.col We can use them to display a more colorful histogram to identify positive and negative returns.

grid functions For example, we can change the periodicity of grid.ticks.on to control the interval between grid lines and grid.ticks.lty to control the line type of grids.

As for the original functionality of chart.TimeSeries, it allows users to add event lines and period areas. We can replace the basic charting functions for addLines and addPolygon to integrate with plot.xts. At last, using addLegend to control the legend.

These are what I think we can work on. How do you think? Do I get the point?

erichung0404 avatar May 18 '16 06:05 erichung0404