Shorcut for create/add time series from times and values

Share:

Description

This function add a time series to a highchart object.

Usage

1
hc_add_series_times_values(hc, dates, values, ...)

Arguments

hc

A highchart htmlwidget object.

dates

A date vector (same length as values)

values

A numeric vector

...

Aditional arguments for the data series (http://api.highcharts.com/highcharts#series).

Details

This function modify the type of chart to datetime

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 

require("ggplot2")
data(economics, package = "ggplot2")

hc_add_series_times_values(hc = highchart(),
                           dates = economics$date,
                           values = economics$psavert, 
                           name = "Personal Savings Rate")

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.