Skip to content

Mixed/Combo charts when using apex() function to create series #58

@bergatronic

Description

@bergatronic

Hi all,

It does not seem possible to create a series-specific chart type when using the apex() function to map a data frame into series.

Is there some way to use the aes() function to accomplish this?

I have tried to add a "type" mapping in the aes() function but it seems to be ignored

Below is a small reproducible example. I create a stacked area chart and I want to put a point to display the combined total value.

data <- tibble::tibble(x = runif(10), y = runif(10), total = x + y, x_axis = 1:10) %>% 
  dplyr::mutate(dplyr::across(c(x,y,total), cumsum)) %>% 
  tidyr::pivot_longer(names_to = "series", values_to = "value", cols = c(x,y,total)) %>%
  dplyr::arrange(series) %>%
  dplyr::mutate(series_type = ifelse(series == "total", "scatter", "area"))

library(apexcharter)
apex(data, aes(x = x_axis, y = value, group = series, type = series_type)) %>% 
  ax_chart(stacked = TRUE) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions