Description Usage Arguments Details See Also Examples
Add series(s) to chart
1 |
p |
a chartist object. |
values |
values to plot on y axis. |
name |
name the serie, see details (optional). |
... |
Additional parameter. |
Naming the serie (name
) is useful if you want to apply
different options (opt_ist
) for each serie later on. If no
name is specified then the assigns one; type
+ i
where
i
is the serie index and starts from 1
. Names can be retrieved
using name_ist
. See examples.
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 | # basic example
mtcars[1:10,] %>%
chart_ist(x = mpg) %>%
add_ist(disp) %>%
add_ist(hp)
# option applies to both "disp" and "hp"
mtcars[1:10,] %>%
chart_ist(x = mpg) %>%
add_ist(disp) %>%
add_ist(hp) %>%
opt_ist(showArea = TRUE)
# use names to apply different option to each serie
mtcars[1:10,] %>%
chart_ist(x = mpg) %>%
add_ist(disp, name = "disp") %>%
add_ist(hp, name = "hp") %>%
opt_ist(name = "hp", showArea = TRUE, showPoint = FALSE) %>%
opt_ist(name = "disp", lineSmoothing = "step")
# if you haven't assigned names you can retrieve generated ones with name_ist
# See details for generated names logic
mtcars[1:10,] %>%
chart_ist(x = mpg) %>%
add_ist(disp, name = "disp") %>%
add_ist(hp, name = "hp") %>%
name_ist()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.