Learn R Programming

echarty (version 1.7.0)

ec.registerMap: Register a geoJson map

Description

Read geoJSON file to be used in a map chart
Deprecated since v.1.7.0, use ec.init(registerMap=...) instead.

Usage

ec.registerMap(wt = NULL, name = "loadedMapName", data = NULL)

Value

An echarty widget.

Arguments

wt

An echarty widget as returned by ec.init.

name

Name of map.

data

A string starting with http or file. URL strings ending with .svg are assumed to be SVG map files.
Could also be a valid geoJSON or SVG text string. SVG strings start with either <?xml or <svg.

Details

This command replaces the manual setting through p$x$registerMap.
It should always be piped after ec.init.
There should be one map series with attribute 'map' matching the name parameter.

Examples

Run this code
data.frame(name= c('Texas', 'California'), value= c(111, 222)) |> 
ec.init( color= c('lightgray'), visualMap= list(min=111),
  series.param= list(type= 'map', map= 'usa')
) |> 
ec.registerMap('usa', 'https://echarts.apache.org/examples/data/asset/geo/USA.json')

Run the code above in your browser using DataLab