Learn R Programming

highcharter (version 0.1.0)

hc_add_serie: Adding and removing series from highchart objects

Description

Adding and removing series from highchart objects Removing series to highchart objects

Usage

hc_add_serie(hc, ...)

hc_rm_serie(hc, name = NULL)

Arguments

hc
A highchart htmlwidget object.
...
Arguments defined in http://api.highcharts.com/highcharts#chart.
name
The serie's name to delete.

Examples

Run this code
require("dplyr")

data("citytemp")

hc <- highchart() %>% 
  hc_xAxis(categories = citytemp$month) %>% 
  hc_add_serie(name = "Tokyo", data = citytemp$tokyo) %>% 
  hc_add_serie(name = "New York", data = citytemp$new_york) 

hc 

hc %>% 
  hc_add_serie(name = "London", data = citytemp$london, type = "area") %>% 
  hc_rm_serie(name = "New York")

Run the code above in your browser using DataLab