Learn R Programming

highcharter (version 0.1.0)

hc_add_serie_ts2: Shorcut for create/add time series charts from a ts object

Description

This function add a time series to a highchart object from a ts object.

Usage

hc_add_serie_ts2(hc, ts, ...)

Arguments

hc
A highchart htmlwidget object.
ts
A time series object.
...
Aditional arguments for the data series (http://api.highcharts.com/highcharts#series).

Details

This function modify the type of chart to datetime

Examples

Run this code
require("dplyr")

highchart() %>% 
  hc_title(text = "Monthly Airline Passenger Numbers 1949-1960") %>% 
  hc_subtitle(text = "The classic Box and Jenkins airline data") %>% 
  hc_add_serie_ts2(AirPassengers, name = "passengers") %>%
  hc_tooltip(pointFormat =  '{point.y} passengers')

highchart() %>% 
  hc_title(text = "Monthly Deaths from Lung Diseases in the UK") %>% 
  hc_add_serie_ts2(fdeaths, name = "Female") %>%
  hc_add_serie_ts2(mdeaths, name = "Male")

Run the code above in your browser using DataLab