eline: Add lines

Description Usage Arguments Details See Also Examples

View source: R/add.R

Description

Add line serie.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
eline(p, serie, name = NULL, stack = NULL, clickable = TRUE,
  xAxisIndex = 0, yAxisIndex = 0, symbol = NULL, symbolSize = "2 | 4",
  symbolRotate = NULL, showAllSymbol = FALSE, smooth = TRUE,
  legendHoverLink = TRUE, dataFilter = "nearest", z = 2, zlevel = 0,
  tooltip, ...)

eline_(p, serie, name = NULL, stack = NULL, clickable = TRUE,
  xAxisIndex = 0, yAxisIndex = 0, symbol = NULL, symbolSize = "4",
  symbolRotate = NULL, showAllSymbol = FALSE, smooth = TRUE,
  legendHoverLink = TRUE, dataFilter = "nearest", z = 2, zlevel = 0,
  tooltip, ...)

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.

symbol

symbol for point marker, see details for valid values.

symbolSize

of symbol.

symbolRotate

angle by which symbol is rotated, i.e.: 30.

showAllSymbol

By default, a symbol will show only when its corresponding axis label does.

smooth

whether to smooth line.

legendHoverLink

enables legend hover link to the chart.

dataFilter

ECharts data filtering strategy, see details.

z, zlevel

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

tooltip

style of tooltip.

...

any other argument to pass to the serie.

Details

Valid values for symbol:

dataFilter: ECharts will optimize for the situation when data number is much larger than viewport width. It will filter the data showed in one pixel width. And this option is for data filtering strategy.

Valid values for dataFilter are:

See Also

official line 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
28
29
30
## Not run: 
df <- data.frame(x = 1:50, y = runif(50, 5, 10), z = runif(50, 7, 12), w = runif(50, 10, 13))

df %>%
  echart(x) %>%
  eline(y) %>%
  eline(z)

# JS sizing function
sizing <- htmlwidgets::JS("function(value){ return value[1]/1.5}")

df %>%
  echart_("x") %>%
  eline_("y", "w",
         symbolSize = sizing,
         showAllSymbol = TRUE,
         symbol = "emptyCircle") %>%
  etooltip() %>%
  etheme("helianthus")

df %>%
  echart_("x") %>%
  eline_("y", stack = "grp") %>%
  eline_("z", stack = "grp", symbol = "emptyDroplet", showAllSymbol = TRUE, symbolSize = 5) %>%
  eline_("w", showAllSymbol = TRUE, symbolSize = 4, symbol = "emptyHeart", stack = "grp2") %>%
  etooltip() %>%
  elegend() %>%
  etoolbox_magic(type = list("line", "bar"))

## End(Not run)

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