Created
February 24, 2019 21:26
-
-
Save JohnCoene/8c1c045290edd2502744401bd4b6c087 to your computer and use it in GitHub Desktop.
echarts4r multiple series
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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