Skip to content

Instantly share code, notes, and snippets.

@JohnCoene
Last active June 17, 2020 08:45
Show Gist options
  • Save JohnCoene/4f68ca0621e9b589159ad954530370ae to your computer and use it in GitHub Desktop.
Save JohnCoene/4f68ca0621e9b589159ad954530370ae to your computer and use it in GitHub Desktop.
Echarts4r factor order
library(echarts4r)
df <- data.frame(
x = rev(rep(letters, 2)),
y = runif(52),
group = factor(c(rep("C", 26), rep("A", 26)), levels = c("A", "C"))
)
df %>%
dplyr::arrange(group) %>%
group_by(group) %>%
e_charts(x) %>%
e_scatter(y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment