Interactive charts
Arguments
- data
A
data.frame
if used withmapping
otherwise a configurationlist
.- mapping
Default list of aesthetic mappings to use for chart if
data
is adata.frame
.- type
Type of chart.
- ...
Optional arguments (currently not used).
- options
A
list
of options for the chart.- height, width
Height and width for the chart.
- elementId
An optional id.
See also
chartOutput()
/ renderChart()
for usage in Shiny applications.
Examples
library(toastui)
# Some data
mydata <- data.frame(
month = month.name,
value = sample(1:100, 12)
)
# Chart using mapping
chart(mydata, caes(x = month, y = value), type = "bar")
# Otherwise:
chart(
data = list(
categories = mydata$month,
series = list(
list(
name = "Value",
data = mydata$value
)
)
),
options = list(
chart = list(title = "My title"),
legend = list(visible = FALSE)
),
type = "column"
)