Skip to content

Documentation / @finchart/react / ChartSeriesProps

Type Alias: ChartSeriesProps<TSource, TPoint> ​

ChartSeriesProps<TSource, TPoint> = PlainSeriesProps<TSource> | DerivedSeriesProps<TSource, TPoint> | InputSeriesProps<TSource, TPoint>

Defined in: react/src/components/chart-series.tsx:109

One of three ways to get points — handed in (data), derived (derive), or built by someone else (input). The branches are mutually exclusive and can't be mixed.

TypeScript catches giving two at once, but the message is indirect: give both input and derive and you get "Type '(s: OHLC[]) => LineDataPoint[]' is not assignable to type 'undefined'" — it points at the right field, but the reason has to be inferred. That's the nature of a discriminated union, so the message itself can't be improved; this sentence shows up on hover instead.

Type Parameters ​

TSource ​

TSource extends BaseDataPoint

TPoint ​

TPoint extends BaseDataPoint = TSource