unlist facet label

This commit is contained in:
pvictor 2020-12-03 10:33:20 +01:00
parent 70eb611091
commit ff7b5ba7d9
2 changed files with 13 additions and 3 deletions

View File

@ -7,7 +7,10 @@ get_facets <- function(data, vars) {
X = seq_along(facets),
FUN = function(i) {
facet <- facets[[i]]
attr(facet, "keys") <- strsplit(x = names(facets)[i], split = "|__|", fixed = TRUE)
attr(facet, "keys") <- strsplit(
x = names(facets)[i],
split = "|__|", fixed = TRUE
)[[1]]
facet
}
)
@ -94,7 +97,7 @@ ax_facet_wrap <- function(ax,
vars,
nrow = NULL,
ncol = NULL,
labeller = ggplot2::label_value,
labeller = label_value,
chart_height = "300px") {
if (!inherits(ax, "apex"))
stop("ax_facet_wrap only works with charts generated with apex()", call. = FALSE)

View File

@ -4,7 +4,14 @@
\alias{ax_facet_wrap}
\title{Facet wrap for ApexCharts}
\usage{
ax_facet_wrap(ax, vars, nrow = NULL, ncol = NULL, chart_height = "300px")
ax_facet_wrap(
ax,
vars,
nrow = NULL,
ncol = NULL,
labeller = label_value,
chart_height = "300px"
)
}
\arguments{
\item{ax}{An \code{apexcharts} \code{htmlwidget} object.}