Hi,
First of all, thanks for this awesome package !
However, I am having issues customizing the tooltip when making stacked barcharts.
From the example given in the vignette:
library(ggplot2)
library(scales)
library(dplyr)
library(apexcharter)
data("mpg")
n_manufac_year <- count(mpg, manufacturer, year) %>%
group_by(manufacturer) %>%
mutate(pct = n/sum(n)*100)
apex(data = n_manufac_year, type = "column", mapping = aes(x = manufacturer, y = pct, fill = year)) %>%
ax_chart(stacked = TRUE)
How could one display tooltips formatted as below for instance (i.e. containing pct and n values):
dodge
1999: 43.2% (16)
2008: 56.8% (21)
I tried to include a custom formatter but I am afraid I do not get the JS logic
apex(data = n_manufac_year, type = "column", mapping = aes(x = manufacturer, y = pct, fill = year)) %>%
ax_chart(stacked = TRUE) %>%
ax_tooltip(
y = list(
formatter = JS("function(value) {return value + '%'}")
)
)
Hi,
First of all, thanks for this awesome package !
However, I am having issues customizing the tooltip when making stacked barcharts.
From the example given in the vignette:
How could one display tooltips formatted as below for instance (i.e. containing
pctandnvalues):I tried to include a custom formatter but I am afraid I do not get the JS logic