First, you should load recharts
:
library(recharts)
SymbolList is a vector of symbol names. You can use setSymbols
to define your own symboList. The symbolList is used along with series in a looping manner.
The recommended approach to use setSymbols
is chart %>% setSymbols(...)
.
All the function names have two forms: small camel and lowercase_underscore (endorsed by Hadley Wickham). To be lazy, we also provide short forms as well (e.g., sl for symbolList).
setSymbols(chart, symbols = NULL, ...)
set_symbols(chart, symbols = NULL, ...)
set_symbol(chart, symbols = NULL, ...)
set_sl(chart, symbols = NULL, ...)
Arg | Requirement |
---|---|
chart |
Echarts object generated by |
symbols |
A vector assigning symbols. You can use an array of symbols. If the the symbols array is shorter than the levels of the series in length, the last symbol will be used to extend the array. Default NULL.
|
… |
Elipsis. |
g <- echartr(iris, Sepal.Width, Petal.Width, Species)
g
The three series are displayed as ‘circle’, ‘rectangle’ and ‘triangle’. You can overide it by assigning another vector.
g %>% setSymbols(symbols=c('diamond', 'emptycircle', 'emptyrectangle'))
If the symbolList is shorter than the length of series, the last element in the symbolList will be repeated.
g %>% setSymbols(symbols=c('diamond', 'emptycircle'))
And some non-standard symbols are also usable.
g %>% setSymbols(c('pin', 'heart', 'star8'))