setToolbox: Set 'toolbox' 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 toolbox using %>%.

Usage

1
2
3
4
5
6
setToolbox(chart, show = TRUE, language = "cn", controls = c("mark",
  "dataZoom", "dataView", "magicType", "restore", "saveAsImage"), pos = 1,
  bgColor = "rgba(0,0,0,0)", borderColor = "#ccc", borderWidth = 0,
  padding = 5, itemGap = 10, itemSize = 16, color = c("#1e90ff",
  "#22bb22", "#4b0082", "#d2691e"), disableColor = "#ddd",
  effectiveColor = "red", showTitle = TRUE, textStyle = NULL, ...)

Arguments

chart

echarts object generated by echart or echartR

show

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

language

'cn' or 'en', the language of the toolbox tooltips.

controls

which widgets to show. Default 'mark', 'dataZoom', 'dataView', 'magicType', 'restore', 'saveAsImage'.

pos

the clock-position of toolbox, refer to vecPos. Or you can define a vector c(x, y, orient) yourself.#'

bgColor

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

borderColor

border color, default '#ccc'.

borderWidth

border width, default 0px (not shown).

padding

Padding of the toolbox. Default 5px. Could also be a list assigning padding of top, right, bottom and left.

itemGap

Gap between the items. Default 10px.

itemSize

Size of the items. Default 16px.

color

Colors of the toolbox widgets (applied in loops). Default c("#1e90ff", "#22bb22", "#4b0082", "#d2691e").

disableColor

Color for disabled widgets. Default '#ddd'.

effectiveColor

Color for widgets be triggered. Default 'red'.

showTitle

Logical, if widgets title are shown. Default TRUE.

textStyle

A list of the text style of the widgets. Default list(fontFamily=c('Arial, Verdana, sans-serif'), fontSize=12, fontStyle='normal', fontWeight='normal')

...

elipsis

Value

A modified echart object

References

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

Examples

1
2
3
4
5
## Not run: 
g = iris %>% echartR(x=Sepal.Width, y=Petal.Width, series=Species, type='scatter')
g %>% setToolbox(TRUE, 'en')

## End(Not run)

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