Learn R Programming

quantmod (version 0.4.26)

chartTheme: Create A Chart Theme

Description

Create a chart.theme object for use within chartSeries to manage desired chart colors.

Usage

chartTheme(theme = "black", ...)

Value

A chart.theme object

Arguments

theme

name of base theme

...

name=value pairs to modify

Author

Jeffrey A. Ryan

Details

Used as an argument to the chartSeries family of functions, chartTheme allows for on-the-fly modification of pre-specified chart ‘themes’. Users can modify a pre-built theme in-place, or copy the theme to a new variable for use in subsequent charting calls.

Internally a chart.theme object is nothing more than a list of values organized by chart components. The primary purpose of this is to facilitate minor modification on the fly, as well as provide a template for larger changes.

Setting style arguments for TA calls via chartTheme requires the user to pass the styles as name=value pairs with a name containing the TA call in question. See examples for assistance.

Current components that may be modified with appropriate values:

  • fg.col: foreground color

  • bg.col: background color

  • grid.col: grid color

  • border: border color

  • minor.tick: minor tickmark color

  • major.tick: major tickmark color

  • up.col: up bar/candle color

  • dn.col: down bar/candle color

  • up.up.col: up after up bar/candle color

  • up.dn.col: up after down bar/candle color

  • dn.dn.col: down after down bar/candle color

  • dn.up.col: down after up bar/candle color

  • up.border: up bar/candle border color

  • dn.border: down bar/candle border color

  • up.up.border: up after up bar/candle border color

  • up.dn.border: up after down bar/candle border color

  • dn.dn.border: down after down bar/candle border color

  • dn.up.border: down after up bar/candle border color

See Also

chartSeries

Examples

Run this code
chartTheme()
chartTheme('white')
chartTheme('white',up.col='blue',dn.col='red')

# A TA example
chartTheme(addRSI.col='red')

str(chartTheme())

Run the code above in your browser using DataLab