Description Usage Arguments Details Examples
Add a candle figure to the chart.
1 2 3 4 5 6 7 8 |
g |
An object of class |
... |
Options to pass to the figure, including |
sync |
Whether to sync the axis data (align) with that
used in other figures, set to |
data |
A dataset ( |
inherit_asp |
Whether to inherit the aspects paseed to
|
alias |
Name of the range to display on tooltips, labels, etc. |
Requires the following aspects defined:
open
close
high
low
If no color
argument is passed the candles are colored
according to their trend (open > close = "up").
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | stock <- structure(
list(
date = structure(c(18626, 18627, 18631, 18632), class = "Date"),
open = c(39.52, 39.330002, 40.169998, 41.5),
high = c(
39.73,
40,
41.560001,
42.040001
),
low = c(
39.200001,
39.029999,
39.939999,
40.77
),
close = c(
39.34,
39.880001,
41.400002,
41.16
)
),
row.names = c(NA, -4L),
class = c(
"tbl_df",
"tbl",
"data.frame"
)
)
g2(stock, asp(date, open = open, close = close, high = high, low = low)) %>%
fig_candle() %>%
gauge_x_time_cat()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.