Skip to content

Instantly share code, notes, and snippets.

@JohnCoene
Created February 24, 2019 21:26
Show Gist options
  • Select an option

  • Save JohnCoene/8c1c045290edd2502744401bd4b6c087 to your computer and use it in GitHub Desktop.

Select an option

Save JohnCoene/8c1c045290edd2502744401bd4b6c087 to your computer and use it in GitHub Desktop.
echarts4r multiple series
df <- data.frame(
x = LETTERS[1:5],
y = runif(5, 1, 5),
z = runif(5, 3, 7)
)
# gather the variables
df_gather <- df %>% tidyr::gather("group", "y_axis", y, z)
# plot
df_gather %>%
group_by(group) %>% # one serie per group
e_charts(x) %>%
e_bar(y_axis) %>%
e_tooltip(trigger = "item")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment