apexcharter/man/apex.Rd

91 lines
2.1 KiB
Plaintext
Raw 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}
2019-07-24 12:20:22 +02:00
\title{Quick ApexChart}
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-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-02-12 11:57:24 +01:00
\item{type}{Specify the chart type. Available Options:
\code{"column"}, \code{"bar"}, \code{"line"},
\code{"area"}, \code{"spline"}, \code{"pie"}, \code{"donut"},
2020-02-12 16:37:47 +01:00
\code{"radialBar"}, \code{"radar"}, \code{"scatter"}, \code{"heatmap"},
\code{"timeline"}.}
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
use \code{\link{config_update}} for more control.}
2019-02-15 23:33:40 +01:00
2020-02-12 16:37:47 +01:00
\item{serie_name}{Name for the serie displayed in tooltip,
only used for single serie.}
2019-02-14 15:50:58 +01:00
\item{width}{A numeric input in pixels.}
\item{height}{A numeric input in pixels.}
\item{elementId}{Use an explicit element ID for the widget.}
}
2019-07-24 12:20:22 +02:00
\value{
A \code{apexcharts} \code{htmlwidget} object.
}
2019-02-14 15:50:58 +01:00
\description{
2020-02-12 11:57:24 +01:00
Initialize a chart with three main parameters :
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)
2019-06-24 15:18:38 +02:00
library(dplyr)
2019-11-26 11:26:47 +01:00
library(apexcharter)
2019-06-24 15:18:38 +02:00
# 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"
)
}