Learn R Programming

c3 (version 0.3.2)

grid: C3 Grid

Description

Modify grid and line elements on both x and y axis

Usage

grid(c3, axis, show = TRUE, lines = NULL, ticks = NULL, ...)

# S3 method for c3 grid(c3, axis, show = TRUE, lines = NULL, ticks = NULL, ...)

Value

c3

Arguments

c3

c3 htmlwidget object

axis

character 'x' or 'y'

show

boolean

lines

dataframe with options:

value

numeric, character or date depending on axis

text

character (optional)

class

character css class (optional)

position

character one of 'start', 'middle', 'end' (optional)

ticks

boolean placeholder. Not yet implemented in C3.js

...

additional options passed to the grid object

See Also

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

Examples

Run this code
 mtcars %>%
   c3(x = 'mpg', y = 'wt', group = 'cyl') %>%
   c3_scatter() %>%
   grid('y') %>%
   grid('x', show = FALSE, lines = data.frame(value=c(17, 21),
                                              text= c('Line 1', 'Line 2')))

Run the code above in your browser using DataLab