Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

e_pie

Pie


Description

Draw pie and donut charts.

Usage

e_pie(e, serie, name = NULL, legend = TRUE, rm_x = TRUE, rm_y = TRUE, ...)

e_pie_(e, serie, name = NULL, legend = TRUE, rm_x = TRUE, rm_y = TRUE, ...)

Arguments

e

An echarts4r object as returned by e_charts or a proxy as returned by echarts4rProxy.

serie

Column name of serie to plot.

name

name of the serie.

legend

Whether to add serie to legend.

rm_x, rm_y

Whether to remove x and y axis, defaults to TRUE.

...

Any other option to pass, check See Also section.

See Also

Examples

mtcars %>%
  head() %>%
  dplyr::mutate(model = row.names(.)) %>%
  e_charts(model) %>%
  e_pie(carb)

# timeline
df <- data.frame(
  grp = c("A", "A", "A", "B", "B", "B"),
  labels = rep(LETTERS[1:3], 2),
  values = runif(6, 1, 5)
)

df %>%
  group_by(grp) %>%
  e_charts(labels, timeline = TRUE) %>%
  e_pie(values)

echarts4r

Create Interactive Graphs with 'Echarts JavaScript' Version 5

v0.4.0
Apache License (>= 2.0)
Authors
John Coene [aut, cre, cph], Wei Su [ctb], Helgasoft [ctb], Xianying Tan [ctb] (<https://orcid.org/0000-0002-6072-3521>)
Initial release
2021-03-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.