Skip to contents

hc_add_series for xts objects

Usage

# S3 method for class 'xts'
hc_add_series(hc, data, ...)

# S3 method for class 'ohlc'
hc_add_series(hc, data, type = "candlestick", ...)

Arguments

hc

A highchart htmlwidget object.

data

A xts object.

...

Arguments defined in https://api.highcharts.com/highcharts/plotOptions.series.

type

The way to show the xts object. Can be 'candlestick' or 'ohlc'.

Examples


if(require("quantmod")){
  x <- getSymbols("GOOG", auto.assign = FALSE)
  hchart(x) 
}
#> Loading required package: quantmod
#> Loading required package: xts
#> Loading required package: zoo
#> 
#> Attaching package: ‘zoo’
#> The following objects are masked from ‘package:base’:
#> 
#>     as.Date, as.Date.numeric
#> Loading required package: TTR
#> Registered S3 method overwritten by 'quantmod':
#>   method            from
#>   as.zoo.data.frame zoo