aesStyle: Define Aesthetic Elements of Echarts Object

Description Usage Arguments Value Examples

View source: R/options.R

Description

An Echarts object uses itemStyle heavily. You can use itemStyle to compose an itemStyle list.

Contained in an itemStyle object are

atomic features

'color', 'borderColor', 'borderWidth', 'barBorderColor', 'barBorderRadius', 'barBorderWidth', which you can directly assign values

object features

'lineStyle', 'textStyle','areaStyle', 'chordStyle', 'nodeStyle', 'linkStyle', which you can yield by aesStyle function family

mixed object features

'label' and 'labelLine', which contains other object features, such as 'lineStyle', 'textStyle'


You can use aesStyle function family ( lineStyle, textStyle, areaStyle, aesChordSytle, labelStyle, labelLineStyle) to compose basic feature objects, and then group them into label or labelLine using labelStyle / labelLineStyle, and finally pack them into an itemStyle object using itemStyle.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
aesStyle(element = c("text", "line", "area", "chord", "node", "link"), ...)

lineStyle(...)

textStyle(...)

areaStyle(...)

chordStyle(...)

nodeStyle(...)

linkStyle(...)

labelStyle(...)

labelLineStyle(...)

itemStyle(...)

Arguments

element

String, could be 'text', 'line', 'area', 'chord', 'node', or 'link', corresponding to textStyle, lineStyle, areaStyle, chordStyle, nodeStyle, linkStyle

...

The params to form an aesthetic element
The element-specific params list:

itemStyle (normal|emphasis)
color color vector, 'rgba', hex color, or color names.
lineStyle for line, k charts and markLine, lineStyle
textStyle textStyle
areaStyle for stacked line chart and map, areaStyle
chordStyle for chord chart, chordStyle
nodeStyle for force chart, nodeStyle
linkStyle for force chart, linkStyle
borderColor color vector, 'rgba', hex color, or color names.
borderWidth for symbol, symbole, pie chart, map and markPoint, numeric
barBorderColor for symbol, symbole, pie chart, map and markPoint, numeric
barBorderRadius numeric vector length 1 or 4 (right-bottom-left-top), default 0
barBorderWidth numeric vector length 1 or 4 (right-bottom-left-top), default 00
label for line, bar, k, scatter, pie, map, force, funnel charts and markPoint, markLine, labelStyle
labelLine for pie and funnel chart, labelLineStyle
label
show TRUE|FALSE, default TRUE
position
  • for pie, 'outer'|'inner';

  • for funnel, 'inner'|'left'|'right';

  • for line, bar, k, scatter, 'top'|'right'|'inside'|'left'|'bottom';

  • for bar, additionally 'insideLeft' | 'insideRight' | 'insideTop' | 'insideBottom'

rotate chord chart only. TRUE|FALSE, default FALSE
distance chord and pie chart only. numeric, default 10
formatter setTooltip
textStyle textStyle
x treemap only, numeric
y treemap only, numeric
labelLine
show TRUE|FALSE, default TRUE
length numeric or 'auto', default 40
lineStyle lineStyle
textStyle
color color vector, 'rgba', hex color, or color names.
decoration only for tooltip. string, default 'none'
align 'left' | 'right' | 'center'
baseline 'top' | 'bottom' | 'middle'
fontFamily valid font family name
fontSize numeric, default 12
fontStyle 'normal' | 'italic' | 'oblique', default 'normal'
fontWeight 'normal' | 'bold' | 'bolder' | 'lighter' or numeric, default 'normal'
lineStyle
color color vector, 'rgba', hex color, or color names.
type 'solid' | 'dotted' | 'dashed', for tree, additionally 'curve' | 'broken'. Default 'solid'
width numeric
shadowColor color vector, 'rgba', hex color, or color names.
shadowBlur numeric, default 5
shadowOffsetX numeric, default 3
shadowOffsetY numeric, default 3
areaStyle
color color vector, 'rgba', hex color, or color names.
type only 'default'
chordStyle
width numeric, default 1
color color vector, 'rgba', hex color, or color names.
borderWidth numeric, default 1
borderColor color vector, 'rgba', hex color, or color names.
nodeStyle
color color vector, 'rgba', hex color, or color names.
borderWidth numeric, default 1
borderColor color vector, 'rgba', hex color, or color names.
linkStyle
type 'curve'|'line'
color color vector, 'rgba', hex color, or color names. default '#5182ab'
width numeric, default 1

Value

A list

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
lab = labelStyle(show=TRUE, position='inside',
                textStyle=textStyle(color='red'))
styLine = lineStyle(color='#fff', width=4, shadowBlur=5)
itemStyle = list(normal=itemStyle(lineStyle=styLine, label=lab),
                  emphasis=itemStyle(lineStyle=styLine, label=lab)
              )

## End(Not run)

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