Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bergatronic opened this issue Jun 26, 2022 · 0 comments
Open

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

bergatronic opened this issue Jun 26, 2022 · 0 comments

Comments

@bergatronic
Copy link

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) 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant