elegend: Add legend

Description Usage Arguments Examples

View source: R/options.R

Description

Add legend

Usage

1
2
3
4
5
6
elegend(p, legend, show = TRUE, zlevel = 0, z = 4,
  orient = "horizontal", x = "center", y = "top",
  backgroundColor = "rgba(0,0,0,0)", borderColor = "#ccc",
  borderWidth = 0, padding = 5, itemGap = 10, itemWidth = 20,
  itemHeight = 14, formatter = NULL, selectedMode = TRUE,
  selected = NULL, textStyle, ...)

Arguments

p

an echart object.

legend

legend.

show

wether to show legend.

z, zlevel

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

orient

orientation, vertical or horizontal.

x

x alignment, center, left or right.

y

y alignment, center, top or bottom.

backgroundColor

background color.

borderColor

border color.

borderWidth

border width.

padding

legend padding.

itemGap

gap between legend items.

itemWidth, itemHeight

width and height of items.

formatter

default formatter.

selectedMode

selection mode.

selected

default selected state.

textStyle

textStyle.

...

any other option to pass to legend.

Examples

1
2
3
4
5
6
7
df <- data.frame(x = LETTERS[1:10], y = runif(10, 0, 10), z = runif(10, 0, 10))

df %>%
  echart(x) %>%
  ebar(y, name = "y - serie") %>%
  ebar(z) %>%
  elegend()

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