Title: | 'C3.js' Chart Library |
---|---|
Description: | Create interactive charts with the 'C3.js' <http://c3js.org/> charting library. All plot types in 'C3.js' are available and include line, bar, scatter, and mixed geometry plots. Plot annotations, labels and axis are highly adjustable. Interactive web based charts can be embedded in R Markdown documents or Shiny web applications. |
Authors: | Matt Johnson [aut, cre] |
Maintainer: | Matt Johnson <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.3.1 |
Built: | 2024-11-22 05:38:01 UTC |
Source: | https://github.com/mrjoh3/c3 |
Imports the pipe operator from magrittr.
lhs %>% rhs
lhs %>% rhs
lhs |
a |
rhs |
a pie settings function |
data.frame(a=c(1,2,3,2),b=c(2,3,1,5)) %>% c3()
data.frame(a=c(1,2,3,2),b=c(2,3,1,5)) %>% c3()
An 'R' wrapper, or htmlwidget, for the c3 javascript charting library by Masayuki Tanaka.
c3(data, x = NULL, y = NULL, group = NULL, width = NULL, height = NULL, axes = NULL, labels = NULL, hide = NULL, onclick = NULL, onmouseover = NULL, onmouseout = NULL, fixString = FALSE, ...)
c3(data, x = NULL, y = NULL, group = NULL, width = NULL, height = NULL, axes = NULL, labels = NULL, hide = NULL, onclick = NULL, onmouseover = NULL, onmouseout = NULL, fixString = FALSE, ...)
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() |
fixString |
boolean option to parse grouping variables that contain wildcard characters such as '(' |
... |
addition options passed to the data object |
Other c3: RColorBrewer
, grid
,
legend
, region
,
subchart
, tooltip
,
xAxis
, zoom
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()
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 bars to a C3 plot
c3_bar(c3, stacked = FALSE, rotated = FALSE, bar_width = 0.6, zerobased = TRUE)
c3_bar(c3, stacked = FALSE, rotated = FALSE, bar_width = 0.6, zerobased = TRUE)
c3 |
c3 htmlwidget object |
stacked |
boolean place bars on top of each other |
rotated |
boolean use to make x-axis vertical |
bar_width |
numeric pixel width of bars |
zerobased |
boolean |
c3
data.frame(a=c(1,2,3,2),b=c(2,3,1,5)) %>% c3() %>% c3_bar(stacked = TRUE)
data.frame(a=c(1,2,3,2),b=c(2,3,1,5)) %>% c3() %>% c3_bar(stacked = TRUE)
Modify the size of the chart within the htmlwidget area. Generally charts size to the div in which they are placed. These options enable finer scale sizing with the div
c3_chart_size(c3, left = NULL, right = NULL, top = NULL, bottom = NULL, width = NULL, height = NULL, ...)
c3_chart_size(c3, left = NULL, right = NULL, top = NULL, bottom = NULL, width = NULL, height = NULL, ...)
c3 |
c3 htmlwidget object |
left |
integer padding pixels |
right |
integer padding pixels |
top |
integer padding pixels |
bottom |
integer padding pixels |
width |
integer pixels |
height |
integer pixels |
... |
additional options passed to the padding and size objects |
c3
data.frame(a = c(1,2,3,2), b = c(2,4,1,5)) %>% c3() %>% c3_chart_size(width = 600, height = 200)
data.frame(a = c(1,2,3,2), b = c(2,4,1,5)) %>% c3() %>% c3_chart_size(width = 600, height = 200)
Manually assign colors
c3_color(c3, colors)
c3_color(c3, colors)
c3 |
c3 htmlwidget object |
colors |
character vector of colors |
c3
data.frame(a = c(1,2,3,2), b = c(2,4,1,5)) %>% c3() %>% c3_color(c('red','black'))
data.frame(a = c(1,2,3,2), b = c(2,4,1,5)) %>% c3() %>% c3_color(c('red','black'))
Manually assign colours
c3_colour(c3, colours)
c3_colour(c3, colours)
c3 |
c3 htmlwidget object |
colours |
character vector of colours |
c3
data.frame(a = c(1,2,3,2), b = c(2,4,1,5)) %>% c3() %>% c3_colour(c('red','black'))
data.frame(a = c(1,2,3,2), b = c(2,4,1,5)) %>% c3() %>% c3_colour(c('red','black'))
Create simple Donut charts
c3_donut(c3, expand = TRUE, title = NULL, width = NULL, show = TRUE, threshold = NULL, format = NULL, ...)
c3_donut(c3, expand = TRUE, title = NULL, width = NULL, show = TRUE, threshold = NULL, format = NULL, ...)
c3 |
c3 htmlwidget object |
expand |
boolean expand segment on hover |
title |
character |
width |
integer pixels width of donut |
show |
boolean show labels |
threshold |
numeric proportion of segment to hide label |
format |
character label js function, wrap character or character vector in JS() |
... |
additional values passed to the donut label object |
c3
data.frame(red=20,green=45,blue=10) %>% c3() %>% c3_donut(title = 'Colors')
data.frame(red=20,green=45,blue=10) %>% c3() %>% c3_donut(title = 'Colors')
Create simple Gauge Charts
c3_gauge(c3, label = NULL, min = 0, max = 100, units = NULL, width = NULL, pattern = c("#FF0000", "#F97600", "#F6C600", "#60B044"), threshold = list(unit = "value", max = 100, values = c(30, 60, 90, 100)), height = NULL, ...)
c3_gauge(c3, label = NULL, min = 0, max = 100, units = NULL, width = NULL, pattern = c("#FF0000", "#F97600", "#F6C600", "#60B044"), threshold = list(unit = "value", max = 100, values = c(30, 60, 90, 100)), height = NULL, ...)
c3 |
c3 htmlwidget object |
label |
list with options:
|
min |
numeric |
max |
numeric |
units |
character appended to numeric value |
width |
integer pixel width of the arc |
pattern |
character vector or palette of colors |
threshold |
list with options:
|
height |
integer pixel height of the chart. Proportion of gauge never changes so height scales with width despite this setting. |
... |
additional values passed to the gauge, color and size objects |
c3
data.frame(data=10) %>% c3() %>% c3_gauge(title = 'Colors')
data.frame(data=10) %>% c3() %>% c3_gauge(title = 'Colors')
Add lines to a C3 plot
c3_line(c3, type, stacked = FALSE, connectNull = FALSE, step_type = NULL)
c3_line(c3, type, stacked = FALSE, connectNull = FALSE, step_type = NULL)
c3 |
c3 htmlwidget object |
type |
character type of line plot. Must be one of:
|
stacked |
boolean |
connectNull |
boolean connect null (missing) data points |
step_type |
character, one of:
|
c3
data.frame(a=c(1,2,3,2),b=c(2,3,1,5)) %>% c3() %>% c3_line('spline')
data.frame(a=c(1,2,3,2),b=c(2,3,1,5)) %>% c3() %>% c3_line('spline')
Use multiple geometry types in a single plot
c3_mixedGeom(c3, types, type = "line", stacked = NULL)
c3_mixedGeom(c3, types, type = "line", stacked = NULL)
c3 |
c3 htmlwidget object |
types |
list containing key value pairs of column header and plot type |
type |
character default plot type where not defined |
stacked |
character vector of column headers to stack |
c3
data <- data.frame(a = abs(rnorm(20) *10), b = abs(rnorm(20) *10), c = abs(rnorm(20) *10), d = abs(rnorm(20) *10)) data %>% c3() %>% c3_mixedGeom(type = 'bar', stacked = c('b','d'), types = list(a='area', c='spline'))
data <- data.frame(a = abs(rnorm(20) *10), b = abs(rnorm(20) *10), c = abs(rnorm(20) *10), d = abs(rnorm(20) *10)) data %>% c3() %>% c3_mixedGeom(type = 'bar', stacked = c('b','d'), types = list(a='area', c='spline'))
C3 Pie Charts
c3_pie(c3, show = TRUE, threshold = NULL, format = NULL, expand = TRUE, ...)
c3_pie(c3, show = TRUE, threshold = NULL, format = NULL, expand = TRUE, ...)
c3 |
c3 htmlwidget object |
show |
boolean show labels |
threshold |
numeric proportion of segment to hide label |
format |
character label js function, wrap character or character vector in JS() |
expand |
boolean expand segment on hover |
... |
additional values passed to the pie label object |
c3
data.frame(red = 20, green = 45, blue = 10) %>% c3() %>% c3_pie()
data.frame(red = 20, green = 45, blue = 10) %>% c3() %>% c3_pie()
For scatter plots options are defined in the 'c3' function. Options are limited to x, y and groups
c3_scatter(c3)
c3_scatter(c3)
c3 |
c3 htmlwidget object |
c3
mtcars %>% c3(x = 'mpg', y = 'wt', group = 'cyl') %>% c3_scatter()
mtcars %>% c3(x = 'mpg', y = 'wt', group = 'cyl') %>% c3_scatter()
Define options for selecting data within the plot area
c3_selection(c3, enabled = FALSE, grouped = FALSE, multiple = FALSE, draggable = FALSE, isselectable = JS("function () { return true; }"), ...)
c3_selection(c3, enabled = FALSE, grouped = FALSE, multiple = FALSE, draggable = FALSE, isselectable = JS("function () { return true; }"), ...)
c3 |
c3 htmlwidget object |
enabled |
boolean |
grouped |
boolean |
multiple |
boolean |
draggable |
boolean |
isselectable |
character js function, wrap character or character vector in JS() |
... |
additional options passed to data selection object |
c3
data.frame(a = c(1,2,3,2), b = c(2,3,1,5)) %>% c3() %>% c3_selection(enabled = TRUE, multiple = TRUE)
data.frame(a = c(1,2,3,2), b = c(2,3,1,5)) %>% c3() %>% c3_selection(enabled = TRUE, multiple = TRUE)
Use Viridis palette options
c3_viridis(c3, pal = "D")
c3_viridis(c3, pal = "D")
c3 |
c3 htmlwidget object |
pal |
character palette options |
c3
data.frame(a = c(1,2,3,2), b = c(2,4,1,5)) %>% c3() %>% c3_viridis()
data.frame(a = c(1,2,3,2), b = c(2,4,1,5)) %>% c3() %>% c3_viridis()
Output and render functions for using c3 within Shiny applications and interactive Rmd documents.
c3Output(outputId, width = "100%", height = "100%") renderC3(expr, env = parent.frame(), quoted = FALSE)
c3Output(outputId, width = "100%", height = "100%") renderC3(expr, env = parent.frame(), quoted = FALSE)
outputId |
output variable to read from |
width , height
|
Must be a valid CSS unit (like |
expr |
An expression that generates a c3 |
env |
The environment in which to evaluate |
quoted |
Is |
For plots where stacking is required this function will define the columns to be stacked based on column headers.
check_stacked(c3, stacked)
check_stacked(c3, stacked)
c3 |
c3 htmlwidget object |
stacked |
boolean |
c3 object
Modify grid and line elements on both x and y axis
grid(c3, axis, show = TRUE, lines = NULL, ticks = NULL, ...) ## S3 method for class 'c3' grid(c3, axis, show = TRUE, lines = NULL, ticks = NULL, ...)
grid(c3, axis, show = TRUE, lines = NULL, ticks = NULL, ...) ## S3 method for class 'c3' grid(c3, axis, show = TRUE, lines = NULL, ticks = NULL, ...)
c3 |
c3 htmlwidget object |
axis |
character 'x' or 'y' |
show |
boolean |
lines |
dataframe with options:
|
ticks |
boolean placeholder. Not yet implemented in C3.js |
... |
additional options passed to the grid object |
c3
Other c3: RColorBrewer
, c3
,
legend
, region
,
subchart
, tooltip
,
xAxis
, zoom
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')))
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')))
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.
legend(c3, hide = FALSE, position = NULL, inset = NULL, item = NULL, ...) ## S3 method for class 'c3' legend(c3, hide = FALSE, position = NULL, inset = NULL, item = NULL, ...)
legend(c3, hide = FALSE, position = NULL, inset = NULL, item = NULL, ...) ## S3 method for class 'c3' legend(c3, hide = FALSE, position = NULL, inset = NULL, item = NULL, ...)
c3 |
c3 htmlwidget object |
hide |
boolean or character of parameters to hide |
position |
character one of 'bottom', 'right', 'inset' |
inset |
list with options:
|
item |
list with options:
|
... |
additional options passed to the legend object |
c3
Other c3: RColorBrewer
, c3
,
grid
, region
,
subchart
, tooltip
,
xAxis
, zoom
mtcars %>% c3(x = 'mpg', y = 'wt', group = 'cyl') %>% c3_scatter() %>% legend(position = 'right')
mtcars %>% c3(x = 'mpg', y = 'wt', group = 'cyl') %>% c3_scatter() %>% legend(position = 'right')
Modify point options
point_options(c3, show = TRUE, r = 2.5, expand = TRUE, expand.r = 1.75, select.r = 4)
point_options(c3, show = TRUE, r = 2.5, expand = TRUE, expand.r = 1.75, select.r = 4)
c3 |
c3 htmlwidget object |
show |
boolean |
r |
numeric radius of point |
expand |
boolean |
expand.r |
numeric multiplier for radius expansion |
select.r |
numeric multiplier for radius expansion |
c3
data.frame(a = c(1,2,3,2), b = c(2,4,1,5)) %>% c3() %>% point_options(r = 5, expand.r = 2)
data.frame(a = c(1,2,3,2), b = c(2,4,1,5)) %>% c3() %>% point_options(r = 5, expand.r = 2)
Use RColorBrewer palettes
RColorBrewer(c3, pal = "Spectral") ## S3 method for class 'c3' RColorBrewer(c3, pal = "Spectral")
RColorBrewer(c3, pal = "Spectral") ## S3 method for class 'c3' RColorBrewer(c3, pal = "Spectral")
c3 |
c3 htmlwidget object |
pal |
character palette must match 'RColorBrewer::brewer.pal.info' |
c3
Other c3: c3
, grid
,
legend
, region
,
subchart
, tooltip
,
xAxis
, zoom
data.frame(a = c(1,2,3,2), b = c(2,4,1,5), c = c(5,3,4,1)) %>% c3() %>% RColorBrewer()
data.frame(a = c(1,2,3,2), b = c(2,4,1,5), c = c(5,3,4,1)) %>% c3() %>% RColorBrewer()
Regions are defined in multiple axis by passing a single 'data.frame'
region(c3, regions) ## S3 method for class 'c3' region(c3, regions)
region(c3, regions) ## S3 method for class 'c3' region(c3, regions)
c3 |
c3 htmlwidget object |
regions |
data.frame with columns listed below. Any columns can be missing but results may be unexpected.
|
c3
Other c3: RColorBrewer
, c3
,
grid
, legend
,
subchart
, tooltip
,
xAxis
, zoom
mtcars %>% c3(x = 'mpg', y = 'wt', group = 'cyl') %>% c3_scatter() %>% region(data.frame(axis = 'x', start = 17, end = 21))
mtcars %>% c3(x = 'mpg', y = 'wt', group = 'cyl') %>% c3_scatter() %>% region(data.frame(axis = 'x', start = 17, end = 21))
Subcharts are defined in multiple axis by passing a single 'data.frame'. Subcharts are listed as an experimental feature in the C3 documentation).
subchart(c3, height = 20, onbrush = NULL) ## S3 method for class 'c3' subchart(c3, height = 20, onbrush = NULL)
subchart(c3, height = 20, onbrush = NULL) ## S3 method for class 'c3' subchart(c3, height = 20, onbrush = NULL)
c3 |
c3 htmlwidget object |
height |
integer pixels |
onbrush |
character js function, wrap character or character vector in JS() |
c3
Other c3: RColorBrewer
, c3
,
grid
, legend
,
region
, tooltip
,
xAxis
, zoom
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) }')
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) }')
Modify axis tick formatting options
tickAxis(c3, axis, centered = TRUE, format = NULL, culling = NULL, count = NULL, fit = TRUE, values = NULL, rotate = 0, outer = TRUE, ...)
tickAxis(c3, axis, centered = TRUE, format = NULL, culling = NULL, count = NULL, fit = TRUE, values = NULL, rotate = 0, outer = TRUE, ...)
c3 |
c3 htmlwidget object |
axis |
character 'x', 'y' or 'y2' axis |
centered |
boolean (x-axis only) |
format |
character js function, wrap character or character vector in JS() |
culling |
boolean or list defining number of ticks 'list(max = 5)' this option effects tick labels (x-axis only) |
count |
integer number of ticks to display. This effects tick lines and labels |
fit |
boolean position ticks evenly or set to values (x-axis only) |
values |
vector. Must match axis format type |
rotate |
integer degrees to rotate labels (x-axis only) |
outer |
boolean show axis outer tick |
... |
additional options passed to axis tick object |
c3
data.frame(a = c(1,2,3,2), b = c(2,4,1,5)) %>% c3() %>% tickAxis('y', values = c(1,3))
data.frame(a = c(1,2,3,2), b = c(2,4,1,5)) %>% c3() %>% tickAxis('y', values = c(1,3))
Modify plot elements that relate to tooltips. C3.js documentation contains an extended example.
tooltip(c3, show = TRUE, grouped = TRUE, format = NULL, position = NULL, contents = NULL, ...) ## S3 method for class 'c3' tooltip(c3, show = TRUE, grouped = TRUE, format = NULL, position = NULL, contents = NULL, ...)
tooltip(c3, show = TRUE, grouped = TRUE, format = NULL, position = NULL, contents = NULL, ...) ## S3 method for class 'c3' tooltip(c3, show = TRUE, grouped = TRUE, format = NULL, position = NULL, contents = NULL, ...)
c3 |
c3 htmlwidget object |
show |
boolean show or hide tooltips |
grouped |
boolean |
format |
list with options:
|
position |
character js function, wrap character or character vector in JS() |
contents |
character js function, wrap character or character vector in JS() |
... |
addition options passed to the tooltip object |
c3
Other c3: RColorBrewer
, c3
,
grid
, legend
,
region
, subchart
,
xAxis
, zoom
data <- data.frame(a = abs(rnorm(20) *10), b = abs(rnorm(20) *10), c = abs(rnorm(20) *10), d = abs(rnorm(20) *10)) data %>% c3() %>% tooltip(format = list(title = htmlwidgets::JS("function (x) { return 'Data ' + x; }"), name = htmlwidgets::JS('function (name, ratio, id, index)', ' { return name; }'), value = htmlwidgets::JS('function (value, ratio, id, index)', ' { return ratio; }')))
data <- data.frame(a = abs(rnorm(20) *10), b = abs(rnorm(20) *10), c = abs(rnorm(20) *10), d = abs(rnorm(20) *10)) data %>% c3() %>% tooltip(format = list(title = htmlwidgets::JS("function (x) { return 'Data ' + x; }"), name = htmlwidgets::JS('function (name, ratio, id, index)', ' { return name; }'), value = htmlwidgets::JS('function (value, ratio, id, index)', ' { return ratio; }')))
Modify plot elements that relate to the axis.
xAxis(c3, show = TRUE, type = "indexed", localtime = NULL, categories = NULL, max = NULL, min = NULL, padding = list(), height = NULL, extent = NULL, label = NULL, ...) ## S3 method for class 'c3' xAxis(c3, show = TRUE, type = "indexed", localtime = NULL, categories = NULL, max = NULL, min = NULL, padding = list(), height = NULL, extent = NULL, label = NULL, ...) yAxis(c3, show = TRUE, inner = NULL, max = NULL, min = NULL, padding = NULL, inverted = NULL, center = NULL, label = NULL, ...) ## S3 method for class 'c3' yAxis(c3, show = TRUE, inner = NULL, max = NULL, min = NULL, padding = NULL, inverted = NULL, center = NULL, label = NULL, ...) y2Axis(c3, show = TRUE, inner = NULL, max = NULL, min = NULL, padding = NULL, inverted = NULL, center = NULL, label = NULL, ...) ## S3 method for class 'c3' y2Axis(c3, show = TRUE, inner = NULL, max = NULL, min = NULL, padding = NULL, inverted = NULL, center = NULL, label = NULL, ...)
xAxis(c3, show = TRUE, type = "indexed", localtime = NULL, categories = NULL, max = NULL, min = NULL, padding = list(), height = NULL, extent = NULL, label = NULL, ...) ## S3 method for class 'c3' xAxis(c3, show = TRUE, type = "indexed", localtime = NULL, categories = NULL, max = NULL, min = NULL, padding = list(), height = NULL, extent = NULL, label = NULL, ...) yAxis(c3, show = TRUE, inner = NULL, max = NULL, min = NULL, padding = NULL, inverted = NULL, center = NULL, label = NULL, ...) ## S3 method for class 'c3' yAxis(c3, show = TRUE, inner = NULL, max = NULL, min = NULL, padding = NULL, inverted = NULL, center = NULL, label = NULL, ...) y2Axis(c3, show = TRUE, inner = NULL, max = NULL, min = NULL, padding = NULL, inverted = NULL, center = NULL, label = NULL, ...) ## S3 method for class 'c3' y2Axis(c3, show = TRUE, inner = NULL, max = NULL, min = NULL, padding = NULL, inverted = NULL, center = NULL, label = NULL, ...)
c3 |
c3 htmlwidget object |
show |
boolean |
type |
character on of 'indexed', timeseries' or 'category' |
localtime |
boolean |
categories |
character vector. Can be used to modify axis labels. Not needed if already defined in data |
max |
numeric set value of axis range |
min |
numeric set value of axis range |
padding |
list with options:
|
height |
integer pixels to set height of axis |
extent |
vector or character function (wrapped in JS()) that returns a vector of values |
label |
can be character or list with options (see c3 axis-x-label):
label position options for horizontal axis are:
label position options for vertical axis are:
|
... |
additional options passed to the axis object |
inner |
boolean show axis inside chart (Y and Y2 axis only) |
inverted |
boolean TRUE will reverse the direction of the axis (Y and Y2 axis only) |
center |
integer or numeric value for center line (Y and Y2 axis only) |
c3
Other c3: RColorBrewer
, c3
,
grid
, legend
,
region
, subchart
,
tooltip
, zoom
data.frame(a=c(1,2,3,2),b=c(2,3,1,5)) %>% c3(axes = list(a = 'y', b = 'y2')) %>% xAxis(label = list(text = 'testing', position = 'inner-center')) %>% y2Axis()
data.frame(a=c(1,2,3,2),b=c(2,3,1,5)) %>% c3(axes = list(a = 'y', b = 'y2')) %>% xAxis(label = list(text = 'testing', position = 'inner-center')) %>% y2Axis()
Enable chart Zoom.
zoom(c3, enabled = TRUE, rescale = NULL, extent = NULL, onzoom = NULL, onzoomstart = NULL, onzoomend = NULL, ...) ## S3 method for class 'c3' zoom(c3, enabled = TRUE, rescale = NULL, extent = NULL, onzoom = NULL, onzoomstart = NULL, onzoomend = NULL, ...)
zoom(c3, enabled = TRUE, rescale = NULL, extent = NULL, onzoom = NULL, onzoomstart = NULL, onzoomend = NULL, ...) ## S3 method for class 'c3' zoom(c3, enabled = TRUE, rescale = NULL, extent = NULL, onzoom = NULL, onzoomstart = NULL, onzoomend = NULL, ...)
c3 |
c3 htmlwidget object |
enabled |
boolean default is TRUE |
rescale |
boolean rescale axis when zooming |
extent |
numeric vector |
onzoom |
character js function, wrap character or character vector in JS() |
onzoomstart |
character js function, wrap character or character vector in JS() |
onzoomend |
character js function, wrap character or character vector in JS() |
... |
additional options passed to the zoom object |
c3
Other c3: RColorBrewer
, c3
,
grid
, legend
,
region
, subchart
,
tooltip
, xAxis
data.frame(a = abs(rnorm(20) * 10), b = abs(rnorm(20) * 10)) %>% c3() %>% zoom()
data.frame(a = abs(rnorm(20) * 10), b = abs(rnorm(20) * 10)) %>% c3() %>% zoom()