Description Usage Arguments Examples
Register a http://geojson.org/ map.
1 | ec_registerMap(ec, mapName, geoJson, specialAreas = NULL)
|
ec |
An |
mapName |
Name of map |
geoJson |
|
specialAreas |
specialAreas |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | library(dplyr)
data("USA_geojson", package = "echarter")
USArrests_ <- USArrests %>%
dplyr::mutate(states = row.names(.))
echart() %>%
ec_registerMap("USA", USA_geojson) %>%
ec_add_series(
type = 'map', mapType = 'USA',
data = USArrests_,
mapping = ecaes(name = states, value = Murder)) %>%
ec_visualMap(
calculable = TRUE,
min = 0, max = 20, text = c("high", "low"),
color = c('#d94e5d','#eac736')) %>%
ec_tooltip(trigger = 'item',formatter = '{b}: {c}')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.