apexcharter/man/apexchart.Rd

70 lines
1.4 KiB
Plaintext
Raw Normal View History

2018-07-30 22:54:39 +02:00
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/apexcharter.R
2019-02-15 22:33:14 +01:00
\name{apexchart}
\alias{apexchart}
2021-11-29 18:58:47 +01:00
\title{Create an ApexCharts widget}
2018-07-30 22:54:39 +02:00
\usage{
2019-11-26 10:17:42 +01:00
apexchart(
ax_opts = list(),
auto_update = TRUE,
width = NULL,
height = NULL,
elementId = NULL
)
2018-07-30 22:54:39 +02:00
}
\arguments{
2019-02-15 22:33:14 +01:00
\item{ax_opts}{A \code{list} in JSON format with chart parameters.}
2018-07-30 22:54:39 +02:00
2020-02-12 11:57:24 +01:00
\item{auto_update}{In Shiny application, update existing chart
2020-02-12 18:21:40 +01:00
rather than generating new one. Can be \code{TRUE}/\code{FALSE} or
2021-11-29 18:58:47 +01:00
use \code{\link[=config_update]{config_update()}} for more control.}
2018-07-30 22:54:39 +02:00
2021-11-29 18:58:47 +01:00
\item{width, height}{A numeric input in pixels.}
2018-07-30 22:54:39 +02:00
\item{elementId}{Use an explicit element ID for the widget.}
}
\value{
2021-11-29 18:58:47 +01:00
An \code{\link[=apexchart]{apexchart()}} \code{htmlwidget} object.
2018-07-30 22:54:39 +02:00
}
\description{
2021-11-29 18:58:47 +01:00
Create an ApexCharts widget
2018-07-30 22:54:39 +02:00
}
\examples{
library(apexcharter)
2019-07-19 14:11:41 +02:00
# Use raw API by passing a list of
# parameters to the function
2019-02-15 22:33:14 +01:00
apexchart(ax_opts = list(
2019-07-19 14:11:41 +02:00
chart = list(
type = "bar"
),
2018-07-30 22:54:39 +02:00
series = list(list(
name = "Example",
data = sample(1:100, 5)
)),
2019-07-19 14:11:41 +02:00
xaxis = list(
categories = LETTERS[1:5]
)
2018-07-30 22:54:39 +02:00
))
2019-07-19 14:11:41 +02:00
# Or use apexchart() to initialize the chart
# before passing parameters
2019-11-26 11:26:47 +01:00
apexchart() \%>\%
ax_chart(type = "bar") \%>\%
2019-07-19 14:11:41 +02:00
ax_series(
list(
name = "Example",
data = sample(1:100, 5)
)
2019-11-26 11:26:47 +01:00
) \%>\%
2019-07-19 14:11:41 +02:00
ax_xaxis(
categories = LETTERS[1:5]
)
2018-07-30 22:54:39 +02:00
}
2021-11-29 18:58:47 +01:00
\seealso{
For quickly create a chart, see \code{\link[=apex]{apex()}}.
}