EVOLUTION-MANAGER
Edit File: hc_add_series_map.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Add a map series</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for hc_add_series_map {highcharter}"><tr><td>hc_add_series_map {highcharter}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Add a map series</h2> <h3>Description</h3> <p>Add a map series </p> <h3>Usage</h3> <pre> hc_add_series_map(hc, map, df, value, joinBy, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>hc</code></td> <td> <p>A <code>highchart</code> <code>htmlwidget</code> object.</p> </td></tr> <tr valign="top"><td><code>map</code></td> <td> <p>A <code>list</code> object loaded from a geojson file.</p> </td></tr> <tr valign="top"><td><code>df</code></td> <td> <p>A <code>data.frame</code> object with data to chart. Code region and value are required.</p> </td></tr> <tr valign="top"><td><code>value</code></td> <td> <p>A string value with the name of the variable to chart.</p> </td></tr> <tr valign="top"><td><code>joinBy</code></td> <td> <p>What property to join the <code>map</code> and <code>df</code></p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Additional shared arguments for the data series (<a href="https://api.highcharts.com/highcharts/series">https://api.highcharts.com/highcharts/series</a>).</p> </td></tr> </table> <h3>Details</h3> <p>This function force the highchart object to be map type. </p> <h3>Examples</h3> <pre> library("dplyr") data("USArrests", package = "datasets") data("usgeojson") USArrests <- mutate(USArrests, state = rownames(USArrests)) highchart() %>% hc_title(text = "Violent Crime Rates by US State") %>% hc_subtitle(text = "Source: USArrests data") %>% hc_add_series_map(usgeojson, USArrests, name = "Murder arrests (per 100,000)", value = "Murder", joinBy = c("woename", "state"), dataLabels = list( enabled = TRUE, format = "{point.properties.postalcode}" ) ) %>% hc_colorAxis(stops = color_stops()) %>% hc_legend(valueDecimals = 0, valueSuffix = "%") %>% hc_mapNavigation(enabled = TRUE) ## Not run: data(worldgeojson, package = "highcharter") data("GNI2014", package = "treemap") highchart(type = "map") %>% hc_add_series_map(map = worldgeojson, df = GNI2014, value = "GNI", joinBy = "iso3") %>% hc_colorAxis(stops = color_stops()) %>% hc_tooltip( useHTML = TRUE, headerFormat = "", pointFormat = "this is {point.name} and have {point.population} people with gni of {point.GNI}" ) ## End(Not run) </pre> <hr /><div style="text-align: center;">[Package <em>highcharter</em> version 0.9.4 <a href="00Index.html">Index</a>]</div> </body></html>