setDataRange: Set 'dataRange' 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 dataRange using %>%.

Usage

1
2
3
4
5
setDataRange(chart, show = TRUE, pos = 8, valueRange = NULL,
  splitNumber = 5, itemGap = 5, labels = NULL, calculable = FALSE,
  borderColor = "#ccc", borderWidth = 0, selectedMode = list(TRUE,
  "single", "multiple"), color = c("#1e90ff", "#f0ffff"), splitList = NULL,
  initialRange = NULL, ...)

Arguments

chart

echarts object generated by echart or echartR

show

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

pos

the clock-position of dataRange, default 8. Refer to vecPos. Or you can define the position vector c(x, y, orient) yourself.

valueRange

The range of the dataRange bar in form of c(min, max). If NULL, echarts default will be used.

splitNumber

How many discrete sections will the dataRange bar be divided into. Default 5. Set it to 0 to set the bar continuous and calculable will be accordingly set TRUE.

itemGap

The gap between itmes in pixels. Default 10px.

labels

The labels to the ends the dataRange bar in form c('high end', 'low end'). Default NULL, the min, max values will be used.

calculable

Logical. If echart calculable feature is open. Default FALSE. If set calculable TRUE, splitNumber will be set 0.

borderColor

The border color of the dataRange bar. Default '#333'.

borderWidth

The border width of the dataRange bar. Default 0px (not shown).

selectedMode

The mode of the dataRange bar, default TRUE. You can also set it 'single' or 'multiple'.

color

The hex vector of colors used for dataRange bar. Default c("#1e90ff", "#f0ffff").

splitList

A list for user-defined value split in the form of list(list(start=m, end=n, label=x, color=hex), ...). If a valid splitList is set, splitNumber will be disabled.

initialRange

Initial selected value range in the form of list(start=m, end=n)

...

Elipsis

Value

A modified echarts object

References

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

Examples

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

g1 = iris %>% echartR(x=Sepal.Width, y=Petal.Width, t=Species, type='scatter')
g1 %>% setDataRange(valueRange=c(0, 2.5))

## End(Not run)

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