apexcharter/man/apex.Rd

91 lines
2.2 KiB
Plaintext
Raw Permalink Normal View History

2019-02-14 15:50:58 +01:00
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/apex.R
\name{apex}
\alias{apex}
2020-10-05 09:44:14 +02:00
\title{Quick ApexCharts}
2019-02-14 15:50:58 +01:00
\usage{
2019-11-26 10:17:42 +01:00
apex(
data,
mapping,
type = "column",
...,
auto_update = TRUE,
2020-04-15 19:32:15 +02:00
synchronize = NULL,
2020-02-12 16:37:47 +01:00
serie_name = NULL,
2019-11-26 10:17:42 +01:00
width = NULL,
height = NULL,
elementId = NULL
)
2019-02-14 15:50:58 +01:00
}
\arguments{
2020-02-12 11:57:24 +01:00
\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}.}
2019-02-14 15:50:58 +01:00
\item{mapping}{Default list of aesthetic mappings to use for chart}
2020-03-04 21:51:40 +01:00
\item{type}{Specify the chart type. Available options:
2020-04-17 20:21:57 +02:00
\code{"column"}, \code{"bar"},
\code{"line"}, \code{"step"}, \code{"spline"},
\code{"area"}, \code{"area-step"}, \code{"area-spline"},
\code{"pie"}, \code{"donut"},
2020-10-06 09:50:27 +02:00
\code{"radialBar"}, \code{"radar"}, \code{"scatter"},
\code{"heatmap"}, \code{"treemap"},
2024-05-13 11:20:25 +02:00
\code{"timeline"}, \code{"dumbbell"} and \code{"slope"}.}
2019-02-14 15:50:58 +01:00
\item{...}{Other arguments passed on to methods. Not currently used.}
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.}
2019-02-15 23:33:40 +01:00
2020-04-15 19:32:15 +02:00
\item{synchronize}{Give a common id to charts to synchronize them (tooltip and zoom).}
2020-02-12 16:37:47 +01:00
\item{serie_name}{Name for the serie displayed in tooltip,
only used for single serie.}
2022-11-09 09:51:05 +01:00
\item{width, height}{A numeric input in pixels.}
2019-02-14 15:50:58 +01:00
\item{elementId}{Use an explicit element ID for the widget.}
}
2019-07-24 12:20:22 +02:00
\value{
2021-11-29 18:58:47 +01:00
An \code{\link[=apexchart]{apexchart()}} \code{htmlwidget} object.
2019-07-24 12:20:22 +02:00
}
2019-02-14 15:50:58 +01:00
\description{
2020-02-12 11:57:24 +01:00
Initialize a chart with three main parameters :
2020-03-04 11:55:23 +01:00
data, mapping and type of chart.
2019-02-14 15:50:58 +01:00
}
2019-06-24 15:18:38 +02:00
\examples{
2019-11-26 11:26:47 +01:00
library(ggplot2)
library(apexcharter)
2019-06-24 15:18:38 +02:00
# make a barchart with a frequency table
data("mpg", package = "ggplot2")
2021-01-15 10:53:51 +01:00
apex(mpg, aes(manufacturer), type = "bar")
2019-06-24 15:18:38 +02:00
# 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"
)
}