Add a map series
Arguments
- hc
A
highcharthtmlwidgetobject.- map
A
listobject loaded from a geojson file.- data
A
data.frameobject with data to chart. Code region and value are required.- value
A string value with the name of the variable to chart.
- joinBy
What property to join the
mapanddata- ...
Additional shared arguments for the data series (https://api.highcharts.com/highcharts/series).
Examples
path <- system.file("maps/custom/world-robinson-lowres.rds", package = "highcharter")
world <- readRDS(path)
income <- subset(world_income, year == 2024)
highchart(type = "map") |>
hc_add_series_map(world, income, value = "gni_per_capita",
joinBy = c("iso-a3", "iso3"), name = "GNI per capita"
) |>
hc_tooltip(valuePrefix = "$", valueDecimals = 0)
