Learn R Programming

c3 (version 0.3.2)

legend: C3 Legend Options

Description

Modify plot elements that relate to the legend. The c3 legend is on by default, this function allows the legend to be removed, or other legend attributes to be set.

Usage

legend(c3, hide = FALSE, position = NULL, inset = NULL, item = NULL, ...)

# S3 method for c3 legend(c3, hide = FALSE, position = NULL, inset = NULL, item = NULL, ...)

Value

c3

Arguments

c3

c3 htmlwidget object

hide

boolean or character of parameters to hide

position

character one of 'bottom', 'right', 'inset'

inset

list with options:

anchor

character one of 'top-left', 'top-right', 'bottom-left', 'bottom-right'

x

integer pixels

y

integer pixels

step

numeric

item

list with options:

onclick

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

onmouseover

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

onmouseout

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

...

additional options passed to the legend object

See Also

Other c3: RColorBrewer(), c3(), grid(), region(), subchart(), tooltip(), xAxis(), zoom()

Examples

Run this code
mtcars %>%
 c3(x = 'mpg', y = 'wt', group = 'cyl') %>%
 c3_scatter() %>%
 legend(position = 'right')

Run the code above in your browser using DataLab