Skip to content

Documentation / @finchart/react / ChartLine

Function: ChartLine()

ChartLine<TSource, TPoint>(props): Element

Defined in: components/chart-line.tsx:85

점을 선으로 잇는다. 시리즈 객체를 만들 필요가 없다.

tsx
// sma20: (source: OHLC[]) => LineDataPoint[] — 파생은 함수 하나다 (README 참조)
<ChartLine color="#f59e0b" derive={sma20} deriveKey={[20]} />

색은 인자다. 테마(모든 라인의 기본색)는 CSS 변수로 두되, "이 지표는 주황"처럼 시리즈마다 다른 것은 여기서 준다 — 캔버스에는 요소가 없어서 CSS가 시리즈 하나를 집을 방법이 없다.

렌더마다 시리즈를 새로 만들지만 파생 캐시는 살아남는다 → <ChartSeries>

Type Parameters

TSource

TSource extends BaseDataPoint

TPoint

TPoint extends BaseDataPoint = TSource

Parameters

props

ChartLineProps<TSource, TPoint>

Returns

Element