apexcharter/man/apex.Rd

72 lines
1.8 KiB
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/apex.R
\name{apex}
\alias{apex}
\title{Quick ApexChart}
\usage{
apex(data, mapping, type = "column", ..., auto_update = TRUE,
width = NULL, height = NULL, elementId = NULL)
}
\arguments{
\item{data}{Default dataset to use for chart. If not already a \code{data.frame}, it will be coerced to with \code{as.data.frame}.}
\item{mapping}{Default list of aesthetic mappings to use for chart}
\item{type}{Specify the chart type. Available Options: \code{"column"}, \code{"bar"}, \code{"line"},
\code{"area"}, \code{"spline"}, \code{"pie"}, \code{"donut"}, \code{"radialBar"}, \code{"radar"}, \code{"scatter"}, \code{"heatmap"}.}
\item{...}{Other arguments passed on to methods. Not currently used.}
\item{auto_update}{In Shiny application, update existing chart rather than generating new one.}
\item{width}{A numeric input in pixels.}
\item{height}{A numeric input in pixels.}
\item{elementId}{Use an explicit element ID for the widget.}
}
\value{
A \code{apexcharts} \code{htmlwidget} object.
}
\description{
Initialize a chart with three main parameters : data, mapping and type of chart.
}
\examples{
library(dplyr)
# make a barchart with a frequency table
data("mpg", package = "ggplot2")
apex(
data = count(mpg, manufacturer),
mapping = aes(x = manufacturer, y = n),
type = "bar"
)
# timeseries
data("economics", package = "ggplot2")
apex(
data = economics,
mapping = aes(x = date, y = uempmed),
type = "line"
)
# you can add option to apex result :
apex(
data = economics,
mapping = aes(x = date, y = uempmed),
type = "line"
) \%>\%
ax_stroke(width = 1)
# with group variable
data("economics_long", package = "ggplot2")
apex(
data = economics_long,
mapping = aes(x = date, y = value01, group = variable),
type = "line"
)
}