API
MapChart

MapChart

RealMap 라이브러리의 차트 모델.

Properties

bubbleScale: BubbleScale readonly

Bubble scale

default :undefined

colorScale: ColorScale readonly

Color scale

default :undefined

drilldownPanel: DrilldownPanel readonly

drilldown panel.

default :undefined

firstMapSeries: MapSeries readonly

차트에 설정된 첫번째 맵시리즈.
시리즈 개요시리즈 설정을 참조한다.

default :undefined

legend: Legend readonly

legend.

default :undefined

map: MapModel readonly

setBaseMap으로 지정되거나, 기본적으로 첫번째 enabled인 맵 모델.

default :undefined

selection: MapSelection readonly

선택 모델.

default :undefined

series: Series readonly

차트에 설정된 첫번째 시리즈.
시리즈 개요시리즈 설정을 참조한다.

default :undefined

subtitle: Subtitle readonly

차트 부제목 모델.

default :undefined

title: Title readonly

차트 타이틀 모델.

default :undefined

tooltip: Tooltip readonly

툴팁 모델.

default :undefined

type: string (opens in a new tab) readonly

기본 시리즈 종류.

시리즈에 type을 지정하지 않으면 이 속성 type의 시리즈로 생성된다.

default :undefined

zoomPanel: ZoomPanel readonly

zoom panel.

default :undefined

Methods

addSeries(source, animate?): Series

시리즈를 추가한다.

ParameterTypeDescription
sourceany (opens in a new tab)시리즈 설정 json.
animate=trueboolean (opens in a new tab)애니메이션 실행 여부.

return 생성된 시리즈 객체.

getMap(name): MapModel

이름이나 index에 해당하는 맵 객체를 리턴한다.

ParameterTypeDescription
namestring (opens in a new tab) | number (opens in a new tab)맵 이름 또는 index.

return 맵 객체

getPoint(id): MapCoord

차트 설정의 map.points로 지정한 위치를 리턴한다.

ParameterTypeDescription
idstring (opens in a new tab)포인트 키.

return [lon, lat]

getSeries(name): Series

이름이나 index에 해당하는 시리즈 객체를 리턴한다.

ParameterTypeDescription
namestring (opens in a new tab) | number (opens in a new tab)시리즈 이름 또는 index.

return 시리즈 객체

load(config, loadAnimation?, callback?): MapChart

기존 모델 설정을 모두 제거하고 초기화 한 후, config로 전달된 설정에 따라 차트를 새로 구성한다.
기존에 생성되었던 시리즈나 게이지들과 축들이 모두 제거되고 새로 생성된다.

ParameterTypeDescription
configChartConfiguration차트 설정 정보
loadAnimation=falseboolean (opens in a new tab)
callback() => [void](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)

loadAsync(config, loadAnimation?, callback?): Promise (opens in a new tab)

load 메서드의 async 버전.

기존 모델 설정을 모두 제거하고 초기화 한 후, config로 전달된 설정에 따라 차트를 새로 구성한다.
기존에 생성되었던 시리즈나 게이지들과 축들이 모두 제거되고 새로 생성된다.

또한 map과 series 옵션에 url 속성이 있는 경우, 해당 url에서 데이터를 가져온 다음,
각 옵션의 map 또는 data 속성을 채운다.

ParameterTypeDescription
configChartConfiguration차트 설정 정보
loadAnimation=falseboolean (opens in a new tab)
callback() => [void](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)

removeSeries(series, animate?): void (opens in a new tab)

기존 시리즈를 제거한다.

ParameterTypeDescription
seriesstring (opens in a new tab) | Series시리즈 이름이나 시리즈 객체.
animate=trueboolean (opens in a new tab)애니메이션 실행 여부.

render(now?): void (opens in a new tab)

다음 rendering frame을 기다리지 않고, 차트를 즉시 다시 그린다.
차트 rendering 작업은 자원 소모가 많고 소용 시간도 적지 않으므로, data나 여러 모델을 수정하는 경우 모든 작업이 완료된 후 한 번 호출해야 한다. 가능하면 이 함수는 호출하지 않고 차트 기본 동작(다음 frame에 이전 변경 사항들을 모아서 한 번 rendering)으로 실행되게 해야 한다.

ParameterType
now=trueboolean (opens in a new tab)

seriesByType(type): Series

지정한 type에 해당하는 첫번째 시리즈 객체를 리턴한다.

ParameterTypeDescription
typestring (opens in a new tab)시리즈 타입

return 시리즈 객체

setBaseMap(indexOrName?): void (opens in a new tab)

차트 축의 기준이 되는 맵 모델을 지정한다.
매개변수를 지정하지 않거나 잘못된 값을 넘기면 첫번째 enabled인 맵으로 설정된다.

ParameterType
indexOrNamestring (opens in a new tab) | number (opens in a new tab)

updateOptions(options, render?): void (opens in a new tab)

load와 달리 기존 모델을 유지하면서 차트 설정 일부를 반영한다.

ParameterTypeDescription
optionsChartConfiguration설정 객체
render=trueboolean (opens in a new tab)true로 지정하면 다시 그리도록 요청한다.