1#' @rdname chart.TimeSeries 2 3 4# New plotting engine function 5chart.TimeSeries.base <- 6 function(R, 7 auto.grid, 8 xaxis, yaxis, 9 yaxis.right, 10 type, 11 lty, 12 lwd, 13 las, 14 main, 15 ylab, 16 xlab, 17 date.format.in, 18 date.format, 19 xlim, 20 ylim, 21 element.color, 22 event.lines, 23 event.labels, 24 period.areas, 25 event.color, 26 period.color, 27 colorset, 28 pch, 29 legend.loc, 30 ylog, 31 cex.axis, 32 cex.legend, 33 cex.lab, 34 cex.labels, 35 cex.main, 36 major.ticks, 37 minor.ticks, 38 grid.color, 39 grid.lty, 40 xaxis.labels, 41 plot.engine, 42 yaxis.pct, 43 ...){ 44 45 #Switch to check for plot engine and direct to respective sub-functions 46 switch(plot.engine, 47 default = { 48 p = 49 chart.TimeSeries.builtin(R=R, 50 auto.grid=auto.grid, 51 xaxis=xaxis, yaxis=yaxis, 52 yaxis.right=yaxis.right, 53 type=type, 54 lty=lty, 55 lwd=lwd, 56 las=las, 57 main=main, 58 ylab=ylab, 59 xlab=xlab, 60 date.format.in=date.format.in, 61 date.format=date.format, 62 xlim=xlim, 63 ylim=ylim, 64 element.color=element.color, 65 event.lines=event.lines, 66 event.labels=event.labels, 67 period.areas=period.areas, 68 event.color=event.color, 69 period.color=period.color, 70 colorset=colorset, 71 pch=pch, 72 legend.loc=legend.loc, 73 ylog=ylog, 74 cex.axis=cex.axis, 75 cex.legend=cex.legend, 76 cex.lab=cex.lab, 77 cex.labels=cex.labels, 78 cex.main=cex.main, 79 major.ticks=major.ticks, 80 minor.ticks=minor.ticks, 81 grid.color=grid.color, 82 grid.lty=grid.lty, 83 xaxis.labels=xaxis.labels, 84 yaxis.pct=yaxis.pct) 85 return(p) 86 }, 87 ggplot2 = { 88 p = chart.TimeSeries.ggplot2(R=R, 89 auto.grid=auto.grid, 90 xaxis=xaxis, yaxis=yaxis, 91 yaxis.right=yaxis.right, 92 type=type, 93 lty=lty, 94 lwd=lwd, 95 las=las, 96 main=main, 97 ylab=ylab, 98 xlab=xlab, 99 date.format.in=date.format.in, 100 date.format=date.format, 101 xlim=xlim, 102 ylim=ylim, 103 element.color=element.color, 104 event.lines=event.lines, 105 event.labels=event.labels, 106 period.areas=period.areas, 107 event.color=event.color, 108 period.color=period.color, 109 colorset=colorset, 110 pch=pch, 111 legend.loc=legend.loc, 112 ylog=ylog, 113 cex.axis=cex.axis, 114 cex.legend=cex.legend, 115 cex.lab=cex.lab, 116 cex.labels=cex.labels, 117 cex.main=cex.main, 118 major.ticks=major.ticks, 119 minor.ticks=minor.ticks, 120 grid.color=grid.color, 121 grid.lty=grid.lty, 122 xaxis.labels=xaxis.labels, 123 yaxis.pct=yaxis.pct) 124 return(p) 125 }, 126 plotly = { 127 p = chart.TimeSeries.plotly(R=R, 128 main=main, 129 ...) 130 return(p) 131 }, 132 googlevis = { 133 p_g = chart.TimeSeries.googlevis(R=R, 134 xlab=xlab, 135 ylab=ylab, 136 main=main, 137 ...) 138 plot(p_g) 139 }, 140 dygraph = { 141 p = chart.TimeSeries.dygraph(R=R) 142 return(p) 143 } 144 ) 145 146 #End Switch 147} 148 149 150 151############################################################################### 152# R (http://r-project.org/) Econometrics for Performance and Risk Analysis 153# 154# Copyright (c) 2004-2020 Peter Carl and Brian G. Peterson 155# 156# This R package is distributed under the terms of the GNU Public License (GPL) 157# for full details see the file COPYING 158# 159# $Id: chart.TimeSeries.R 3579 2018-01-07 13:01:25Z braverock $ 160# 161############################################################################### 162