Description Usage Arguments Value References Examples
Set timeline of Echarts when the echarts object contains timeline slices (t).
When an echart object is generated, you can modify it by setting tooltip using
%>%
.
1 2 3 4 5 6 7 8 | setTimeline(chart, show = TRUE, type = c("time", "number"),
realtime = TRUE, x = 80, y = NULL, x2 = 80, y2 = 0, width = NULL,
height = 50, bgColor = "rgba(0,0,0,0)", borderColor = "#ccc",
borderWidth = 0, controlPosition = c("left", "right", "none"),
autoPlay = FALSE, loop = TRUE, playInterval = 2000, lineStyle = NULL,
label = NULL, checkpointStyle = NULL, controlStyle = NULL,
symbol = "emptyDiamond", symbolSize = 4, currentIndex = 0,
data = NULL, ...)
|
chart |
|
show |
Logical. If or not the timeline is shown. Default TRUE. If you want to remove timeline from the echarts object, set if NULL. |
type |
'time' or 'number' format of the timeline. Default 'time'. |
realtime |
Logical. If or not the changes take effect in realtime manner. Default TRUE. |
x |
x coordinate of the upper left point of the timeline bar. Default 80. |
y |
y coordinate of the upper left point of the timeline bar. Default NULL (automatic). |
x2 |
x coordinate of the upper left point of the timeline bar. Default 80. |
y2 |
y coordinate of the upper left point of the timeline bar. Default 0. |
width |
Width of the timeline. Could be a number or a character in percent form. Default NULL. |
height |
Height of the timeline. Default 50 (px). |
bgColor |
Background color of the timeline. Default "rgba(0,0,0,0)" (transparent). |
borderColor |
Border color of the timeline. Default "#ccc". |
borderWidth |
Border width of the timeline. Default 0 (px) (not shown). |
controlPosition |
Position of the control of the timeline. Could be 'left', 'right' or 'none'. Default 'left'. |
autoPlay |
Logical. If or not the timeline auto displays. Default FALSE. |
loop |
Logical. If or not the timeline displays in loop mode. Default TRUE. |
playInterval |
Interval when displays each timeslice. Default 2000 (ms). |
lineStyle |
A list. Line style of the timeline. Default value: |
label |
A list. Label style of the timeline. Default value: |
checkpointStyle |
A list. Checkpoint style of the timeline. Default value: |
controlStyle |
A list. Control style of the timeline. Default value: |
symbol |
Character. The symbol used in timeline. Default 'emptyDiamond'.
You can use symbols in |
symbolSize |
The size of the symbols. Default 4. |
currentIndex |
The current index position, in correspondance with |
data |
The data list of the timeline, also used as timeline data label. Default NULL. |
... |
Elipsis |
A modified echarts object
http://echarts.baidu.com/echarts2/doc/option.html#title~timeline
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
## type = "number"
iris$tag = 1 + as.integer(row.names(iris)) %% 3
iris = iris[order(iris$tag),]
g = echartR(iris, Sepal.Width, Petal.Width, series=Species, t=tag)
g %>% setTimeline(y2=30, symbol='emptyCircle',
autoPlay=FALSE, data=c('tag 1', 'tag 2', 'tag 3'))
## type = "time"
### You have to use a js function to reformat the label if you want to change
### the label text
iris$date = as.Date(paste0("2013-1-", 1 + as.integer(row.names(iris)) %% 5))
iris = iris[order(iris$date),]
g = echartR(iris, Sepal.Width, Petal.Width, series=Species, t=date)
g %>% setTimeline(y2=30, symbol='emptyCircle', autoPlay=FALSE, label=list(
formatter=JS(paste('function(s) {return s.slice(8,10) + "\u65e5";}'))))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.