ec_registerMap: Register map

Description Usage Arguments Examples

Description

Register a http://geojson.org/ map.

Usage

1
ec_registerMap(ec, mapName, geoJson, specialAreas = NULL)

Arguments

ec

An echarter object as returned by echart.

mapName

Name of map

geoJson

http://geojson.org/.

specialAreas

specialAreas

Examples

 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}')

jeevanyue/echarter documentation built on Oct. 16, 2020, 5:12 a.m.