setGrid: Set 'grid' of Echarts Widgets And Pane

Description Usage Arguments Value References See Also Examples

View source: R/coordsys.R

Description

When an echart object is generated, you can modify it by setting grid using %>%.
It is recommended to put setGrid at the end of the piped command.
When used for 'pane', it is only applicable for scatter, point, bubble, line, area, bar, histogram. When used for 'timeline', it only take in params x, y, x2, y2. When used for 'legend', 'title', 'dataZoom', 'dataRange', 'toolbox', 'roamController', it only takes in params x, y.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
setGrid(chart, index = 1, left = NULL, top = 60, right = "10%",
  bottom = 60, width = NULL, height = NULL, containLabel = FALSE,
  bgColor = NULL, borderColor = NULL, borderWidth = 1,
  shadowBlur = NULL, shadowColor = NULL, shadowOffsetX = 0,
  shadowOffsetY = 0, show = TRUE, z = 2, zlevel = 0,
  widget = c("pane", "timeline", "legend", "title", "dataZoom", "dataRange",
  "toolbox"), ...)

relocTitle(chart, ...)

relocLegend(chart, ...)

relocDataZoom(chart, ...)

relocDataRange(chart, ...)

relocTimeline(chart, ...)

relocToolbox(chart, ...)

Arguments

chart

echarts object generated by echart

index

Integer, index of the widget, if widget is 'pane'. Default 1.

left

Left margin of the plot area. Default NULL ('auto').

top

Top margin of the plot area. Default 60 px.

right

Right margin of the plot area. Default '10%'.

bottom

Bottom margin of the plot area. Default 60 px.

width

Width of the plot area. Default NULL (automatically configured)

height

Height of the plot area. Default NULL (automatically configured)

containLabel

Logical, whether grid area contains axis label. Default FALSE. Set if TRUE when the chart is too small to show the axis label.

bgColor

Background color of plot area. Default transparent ('rgba(0,0,0,0)').

borderColor

Border color of the plot area. Default '#ccc'.

borderWidth

Border width of the plot area. Default 0px (not shown).

shadowBlur

Numeric, size of shadow blur. Only effective when show is TRUE.

shadowColor

Color of the shadow. Only effective when show is TRUE.

shadowOffsetX

Numeric, horizontal offset of the shadow. Only effective when show is TRUE.

shadowOffsetY

Numeric, vertical offset of the shadow. Only effective when show is TRUE.

show

Logical, if grid is shown. Default FALSE.

z

Layer index of the widget. It does not create new canvas. Default 2.

zlevel

Layer index of the canvas. Default 0.

widget

Widget name to set. Could be c('pane', 'timeline', 'legend', 'title', 'dataZoom', 'dataRange', 'toolbox').

pane

the area pane, takes in all the parameters

timeline

timeline widget, only use x, y, x2, y2

legend, title, dataZoom, dataRange, toolbox, roamController

other widgets, only use x, y

...

Other arguments to pass to echarts object.

Value

A modified echarts object

References

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

See Also

relocWidget

Examples

1
2
3
4
5
## Not run: 
g = iris %>% echartR(x=Sepal.Width, y=Petal.Width, series=Species)
g %>% setGrid(x=40, y=40, x2=70, y2=30, bgColor='gray90')

## End(Not run)

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