hctreemap {highcharter} | R Documentation

## Shorcut for create treemaps

### Description

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

### Usage

    hctreemap(tm, ...)

### Arguments

`tm` | A `treemap` object from the treemap package.
`...` | Aditional shared arguments for the data series (http://api.highcharts.com/highcharts#series).

### Examples

    ## 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)

    hctreemap(tm, allowDrillToNode = TRUE, layoutAlgorithm = "squarified") %>%
       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)

[Package highcharter version 0.5.0 Index]