subchart.c3: Add Subchart

Description Usage Arguments Value See Also Examples

View source: R/subchart.R

Description

Subcharts are defined in multiple axis by passing a single 'data.frame'. Subcharts are listed as an experimental feature in the C3 documentation).

Usage

1
2
3
4
subchart(c3, height = 20, onbrush = NULL)

## S3 method for class 'c3'
subchart(c3, height = 20, onbrush = NULL)

Arguments

c3

c3 htmlwidget object

height

integer pixels

onbrush

character js function, wrap character or character vector in JS()

Value

c3

See Also

Other c3: RColorBrewer, c3, grid, legend, region, tooltip, xAxis, zoom

Examples

1
2
3
4
5
data.frame(a = abs(rnorm(20) * 10),
           b = abs(rnorm(20) * 10),
           date = seq(as.Date("2014-01-01"), by = "month", length.out = 20)) %>%
     c3(x = 'date') %>%
     subchart(height = 20, onbrush = 'function (domain) { console.log(domain) }')

c3 documentation built on March 16, 2020, 5:07 p.m.