export_hc: Function to export js file the configuration options

Description Usage Arguments Examples

View source: R/export_hc.R

Description

Function to export js file the configuration options

Usage

1
export_hc(hc, filename = NULL, as = "is", name = NULL)

Arguments

hc

A Highcharts object.

filename

String of the exported file.

as

String to define how to save the configuration options. One of 'is', 'container', 'variable'.

name

A variable used to put as name of the generated object if as is 'variable' and the css/js selector if is as is container.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
fn <- "function(){
  console.log('Category: ' + this.category);
  alert('Category: ' + this.category);
}"

hc <- highcharts_demo() %>%
  hc_plotOptions(
    series = list(
      cursor = "pointer",
      point = list(
        events = list(
          click = JS(fn)
        )
      )
    )
  )
## Not run: 
export_hc(hc, filename = "~/hc_is.js", as = "is")
export_hc(hc, filename = "~/hc_vr.js", as = "variable", name = "objectname")
export_hc(hc, filename = "~/hc_ct.js", as = "container", name = "#selectorid")

## End(Not run)

highcharter documentation built on July 26, 2020, 9:07 a.m.