ebar: Add bars

Description Usage Arguments See Also Examples

View source: R/add.R

Description

Add bar serie.

Usage

1
2
3
4
5
6
7
8
9
ebar(p, serie, name = NULL, stack = NULL, clickable = TRUE,
  xAxisIndex = 0, yAxisIndex = 0, barGap = "100%",
  barCategoryGap = "20%", legendHoverLink = TRUE, z = 2, zlevel = 0,
  ...)

ebar_(p, serie, name = NULL, stack = NULL, clickable = TRUE,
  xAxisIndex = 0, yAxisIndex = 0, barGap = "100%",
  barCategoryGap = "20%", legendHoverLink = TRUE, z = 2, zlevel = 0,
  ...)

Arguments

p

an echart object.

serie

value column name to plot.

name

of serie.

stack

name of the stack.

clickable

whether plot is clickable.

xAxisIndex, yAxisIndex

axis indexes.

barGap, barCategoryGap

distance between each bar.

legendHoverLink

enables legend hover links.

z, zlevel

first and second grade cascading control, the higher z the closer to the top.

...

any other argument to pass to the serie.

See Also

official bar options docs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Not run: 
mtcars %>%
  echart_("mpg") %>%
  ebar_("qsec")

mtcars %>%
  echart_("disp") %>%
  ebar_("mpg", stack = "grp") %>% # stack
  ebar_("qsec", stack = "grp") %>% # stack
  ebar_("wt", stack = "grp2") %>% # not stacked
  etooltip(trigger = "item") %>%
  elegend() %>%
  etoolbox_magic(type = list("stack", "tiled")) %>%
  etoolbox_restore()

df <- data.frame(x = LETTERS[1:4], y = runif(4, 0, 20), z = runif(4, 10, 15), w = runif(4, 15, 30))

df %>%
  echart(x) %>%
  ebar(y, stack = "grp") %>%
  ebar(z, stack = "grp") %>%
  ebar(w, "grp2") %>%
  etheme("macarons") %>%
  etooltip(trigger = "axis") %>%
  etheme("blue")

## End(Not run)

JohnCoene/echarts documentation built on May 22, 2021, 6:18 p.m.