highchartstock() creates a Stock chart with the official Stock Tools GUI,
advanced annotations and technical indicators. Use highchart(type = "stock")
for a Stock chart without these additional interface assets.
Arguments
- hc_opts
A
listobject containing options defined as https://api.highcharts.com/highcharts/.- theme
A
hc_themeclass object-- width
A numeric width in pixels, or a CSS width such as
"100%".- height
A numeric input in pixels.
- elementId
Use an explicit element ID for the widget.
Examples
data(sample_matrix, package = "xts")
prices <- xts::as.xts(sample_matrix)
highchartstock(width = "100%") |>
hc_add_series(prices, name = "Price", id = "price") |>
hc_add_series(type = "sma", linkedTo = "price", name = "5-day mean",
params = list(period = 5)) |>
hc_title(text = "Explore prices with Stock Tools")
