v_specs_datazoom | R Documentation |
Add data zoom to a chart
v_specs_datazoom(
vc,
start = "{label:%Y-%m-%d}",
end = "{label:%Y-%m-%d}",
...,
brush = TRUE
)
vc |
A chart created with |
start , end |
Formatter for the start/end label, e.g. : |
... |
Additional parameters for dataZoom property, see online documentation. |
brush |
Logical, add the ability to brush the chart to zoom in. |
A vchart()
htmlwidget
object.
library(vchartr)
data("economics", package = "ggplot2")
vchart(economics, aes(date, unemploy)) %>%
v_line() %>%
v_specs_datazoom()
co2_emissions %>%
subset(country %in% c("China", "United States", "India")) %>%
vchart() %>%
v_line(aes(year, co2, color = country)) %>%
v_specs_datazoom(start = "{label:.0f}", startValue = 1990, end = "{label:.0f}")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.