hc_add_series_treemap: Shorcut for create treemaps

Description Usage Arguments Examples

View source: R/api-hc-hc_add_series-deprecated.R

Description

This function helps to create higcharts treemaps from treemap objects from the package treemap.

Usage

1

Arguments

hc

A highchart htmlwidget object.

tm

A treemap object from the treemap package.

...

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
## Not run: 

library("treemap")
library("viridis")

data(GNI2014)
head(GNI2014)

tm <- treemap(GNI2014, index = c("continent", "iso3"),
              vSize = "population", vColor = "GNI",
              type = "comp", palette = rev(viridis(6)),
              draw = FALSE)

highchart(height = 800) %>% 
  hc_add_series_treemap(tm, allowDrillToNode = TRUE,
                       layoutAlgorithm = "squarified",
                       name = "tmdata") %>% 
   hc_title(text = "Gross National Income World Data") %>% 
   hc_tooltip(pointFormat = "<b>{point.name}</b>:<br>
                             Pop: {point.value:,.0f}<br>
                             GNI: {point.valuecolor:,.0f}")


## End(Not run)

highcharter documentation built on May 30, 2017, 1:47 a.m.

Search within the highcharter package
Search all R packages, documentation and source code