fixed timeline charts
This commit is contained in:
parent
5e3be7068a
commit
dea01b7e8d
2
R/apex.R
2
R/apex.R
|
@ -121,7 +121,7 @@ make_series <- function(mapdata, mapping, type = NULL, serie_name = NULL, force_
|
|||
warning("'group' aesthetic in candlestick chart is not supported", call. = FALSE)
|
||||
mapdata$group <- NULL
|
||||
series <- parse_candlestick_data(mapdata)
|
||||
} else if (identical(type, "rangeBar")) {
|
||||
} else if (isTRUE(type %in% c("rangeBar", "timeline"))) {
|
||||
if (!all(c("x", "start", "end") %in% names(mapping)))
|
||||
stop("For timeline charts 'x', 'start', and 'end' aesthetics must be provided.", call. = FALSE)
|
||||
if (is.null(mapdata$group))
|
||||
|
|
|
@ -2,8 +2,13 @@ library(apexcharter)
|
|||
|
||||
data("presidential", package = "ggplot2")
|
||||
|
||||
# Basic
|
||||
apex(presidential, aes(x = name, start = start, end = end), "timeline")
|
||||
# Basic (with formated date in tooltip)
|
||||
apex(presidential, aes(x = name, start = start, end = end), "timeline") %>%
|
||||
ax_tooltip(
|
||||
x = list(
|
||||
format = "yyyy"
|
||||
)
|
||||
)
|
||||
|
||||
# With groups
|
||||
apex(presidential,
|
||||
|
|
Loading…
Reference in New Issue