Description Usage Arguments See Also Examples
An 'R' wrapper, or htmlwidget, for the c3 javascript charting library by Masayuki Tanaka.
1 2 3 |
data |
data.frame or tibble |
x |
character column name |
y |
character column name |
group |
character column name |
width |
integer htmlwidget width (separate from plot width) |
height |
integer htmlwidget height (separate from plot height) |
axes |
list, use to assign plot elements to secondary y axis |
labels |
character or list with options:
|
hide |
boolean or character vector of parameters to hide |
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() |
... |
addition options passed to the data object |
Other c3: RColorBrewer
, grid
,
legend
, region
,
subchart
, tooltip
,
xAxis
, zoom
1 2 3 4 5 6 7 8 9 10 11 12 13 | data <- data.frame(a = c(1,2,3,2), b = c(2,3,1,5))
data %>%
c3(onclick = htmlwidgets::JS("function(d, element){console.log(d)}"))
data %>%
c3(axes = list(a = 'y',
b = 'y2')) %>%
y2Axis()
data.frame(sugar = 20, fat = 45, salt = 10) %>%
c3(onclick = htmlwidgets::JS("function(d, element){dp = d}")) %>%
c3_pie()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.