apex | R Documentation |
Initialize a chart with three main parameters : data, mapping and type of chart.
apex(
data,
mapping,
type = "column",
...,
auto_update = TRUE,
synchronize = NULL,
serie_name = NULL,
width = NULL,
height = NULL,
elementId = NULL
)
data |
Default dataset to use for chart. If not already
a |
mapping |
Default list of aesthetic mappings to use for chart |
type |
Specify the chart type. Available options:
|
... |
Other arguments passed on to methods. Not currently used. |
auto_update |
In Shiny application, update existing chart
rather than generating new one. Can be |
synchronize |
Give a common id to charts to synchronize them (tooltip and zoom). |
serie_name |
Name for the serie displayed in tooltip, only used for single serie. |
width , height |
A numeric input in pixels. |
elementId |
Use an explicit element ID for the widget. |
An apexchart()
htmlwidget
object.
library(ggplot2)
library(apexcharter)
# make a barchart with a frequency table
data("mpg", package = "ggplot2")
apex(mpg, aes(manufacturer), 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"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.