Skip to content

Documentation / @finchart/core / slotWidth

Function: slotWidth()

slotWidth<T>(data, mapping, places?): number

Defined in: packages/core/src/series/slot.ts:20

슬롯은 이웃한 봉 사이의 픽셀 간격이다. 폭이 필요한 시리즈 셋(캔들· histogram·bar)이 같은 산술을 쓴다 — 따로 재면 언젠가 어긋난다.

보이는 개수로 플롯 폭을 나누면 데이터 끝을 지나 패닝했을 때 무너진다 — 남은 몇 개가 화면 전체를 나눠 가지면서 거대한 블록이 된다. 간격은 개수가 줄어도 그대로라 폭이 흔들리지 않는다.

Type Parameters

T

T extends BaseDataPoint

Parameters

data

readonly T[]

mapping

XMapping

places?

number[] | null

Returns

number