setDataZoom: Set 'dataZoom' Bar of Echarts

Description Usage Arguments Value References Examples

View source: R/options.R

Description

When an echart object is generated, you can modify it by setting dataZoom using %>%.

Usage

1
2
3
4
setDataZoom(chart, show = TRUE, pos = 6, range = NULL, width = 30,
  fill = "rgba(144,197,237,0.2)", handle = "rgba(70,130,180,0.8)",
  bgColor = "rgba(0,0,0,0)", dataBgColor = "#eee", showDetail = TRUE,
  realtime = FALSE, zoomLock = FALSE, ...)

Arguments

chart

echarts object generated by echart or echartR

show

logical. Show the dataZoom control if TRUE. If you want to remove dataZoom from the echarts object, set it NULL.

pos

the clock-position of dataZoom, refert to vecPos. You can define a vector c(x, y, orient) yourself.

range

A vector of c(min, max). Cannot be out of the frame c(0, 100)

width

The width of the dataZoom bar. Default 20px.

fill

fillerColor of the dataZoom bar, in character 'rgba(red, green, blue, alpha)' format. Default 'rgba(144,197,237,0.2)' ("#90C5ED33").

handle

handleColor of the dataZoom bar, in character 'rgba(red, green, blue, alpha)' format. Default 'rgba(70,130,180,0.8)' ("#4682B4CC").

bgColor

background color. Default transparent ('rgba(0,0,0,0)')

dataBgColor

background color of the data thumbnail (1st series). Default '#eee'.

showDetail

Logical, if show the details when zooming. Defaul TRUE.

realtime

Logical, if realtime display the changes when zooming. Default FALSE.

zoomLock

Logical, if the zoom range is locked. Deafult FALSE.

...

Elipsis

Value

A modified echart object

References

http://echarts.baidu.com/echarts2/doc/option.html#title~dataZoom

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
g = iris %>% echartR(x=Sepal.Width, y=Petal.Width, series=Species, type='scatter')
g %>% setDataZoom(fill=rgba(c(col2rgb('gold'), 0.3)),
                  handle=rgba(c(col2rgb('gold'), 1)))

g1 = iris %>% echartR(x=Sepal.Width, y=Petal.Width, t=Species, type='scatter')
g1 %>% setDataZoom(fill=rgba(c(col2rgb('lightgreen'), 0.2)),
                  handle=rgba(c(col2rgb('darkgreen'), 0.5)))

## End(Not run)

madlogos/recharts2 documentation built on May 21, 2019, 11:03 a.m.