ec.timegrp {echarty}R Documentation

Timeline by groups

Description

Helper function to build timeline data for a grouped data.frame

Usage

ec.timegrp(wt, df = NULL, scol = NULL, xcol = NULL, type = "line", ...)

Arguments

wt

An echarty widget as returned by ec.init

df

A grouped data.frame, required

scol

Vector of column names(strings) or indexes for series, required

xcol

Column name or index for the X-axis. Default (NULL) will set X-axis to consecutive numbers.

type

The series type, default is 'line'

...

Additional attributes to series

Details

Timeline axisType is set to 'category'.
Option titles are built and displayed, user could remove them later.

Value

A widget with timeline and options added

Examples


p <- ec.init() %>% 
  ec.timegrp(iris %>% dplyr::group_by(Species), 
             c('Sepal.Width','Petal.Length'),
             markPoint = list(data=list(list(type='max'),
                                        list(type='min'))) ) 
p$x$opts$legend <- list(list())  # add legend
p


[Package echarty version 0.2.0 Index]