Documentation / @finchart/react / UsePlotOptions
Interface: UsePlotOptions<T>
Defined in: react/src/hooks/use-chart.ts:17
Type Parameters
T
T extends BaseDataPoint
Properties
data?
optionaldata?:T[]
Defined in: react/src/hooks/use-chart.ts:36
The data that series draws. Paired with series.
<ChartContainer> doesn't set this here — it passes it down to children, since each series draws different data.
deps
deps:
PlotDeps|BrowserDeps
Defined in: react/src/hooks/use-chart.ts:27
A finished wiring, or the recipe browserDeps() returns.
Required. Giving it a default would mean this file statically imports browserDeps, and then even consumers who wired things explicitly would carry the entire browser shell (+21.6KB raw / +6.5KB gzip) — a violation of the principle that leaving something out of the wiring keeps it out of the bundle.
followTheme?
optionalfollowTheme?:boolean|ThemeObserverOptions
Defined in: react/src/hooks/use-chart.ts:63
Redraw when the theme moves — prefers-color-scheme, or a class / data-theme / style change on the container or an ancestor it had at mount (an attributes list replaces that default). Off by default, the way browserDeps leaves observeTheme out: a fixed palette should not hold a MutationObserver and a media-query listener it never needs. A theme applied by restructuring the DOM above the chart, or a swapped stylesheet, is out of reach — call plot.requestRender() yourself then.
gridStyle?
optionalgridStyle?:Partial<LineStyle>
Defined in: react/src/hooks/use-chart.ts:40
height?
optionalheight?:number
Defined in: react/src/hooks/use-chart.ts:38
onCrosshair?
optionalonCrosshair?: (crosshair) =>void
Defined in: react/src/hooks/use-chart.ts:73
Fires while the pointer moves over the chart — during a mouse pan too, and during a drag a drawing tool owns if the tool moves the crosshair itself; not during a touch pan or a pinch — and with null when it leaves, once (a drag released outside counts as leaving then): clear the hover state you keep from it there, or a live chart shows a value that is no longer under anything. Comes with which pane it's over and that pane's value.
Parameters
crosshair
CrosshairPayload | null
Returns
void
onXDomainChange?
optionalonXDomainChange?: (change) =>void
Defined in: react/src/hooks/use-chart.ts:83
Fires when the visible x range changes. Infinite scroll listens for this.
Don't subscribe directly with plotRef.current.on(...) — under StrictMode's double mount, the outer effect stays attached to the first, destroyed plot. This prop is safe because it re-attaches together with the plot-creation effect.
Parameters
change
XDomainChangePayload
Returns
void
options?
optionaloptions?:PlotOptions
Defined in: react/src/hooks/use-chart.ts:53
The plot options that have no prop of their own (padding, resizablePanes, shiftVisibleRangeOnNewBar, preserveLiveRightEdgeOnZoomOut, axisDrag, rightOffset, minBarSpacing, maxBarSpacing). A key that is missing reverts to what the plot was built with. Applied before the first series registers, so rightOffset is in place for the first fit whatever the JSX order. axis, style.grid, showGrid and paneGap are not here on purpose — each has one door already.
paneGap?
optionalpaneGap?:number
Defined in: react/src/hooks/use-chart.ts:42
Gap between panes (px). The divider sits here.
series?
optionalseries?:Series<T>
Defined in: react/src/hooks/use-chart.ts:29
Omit it to decide what to draw later — that's how <ChartContainer> uses this.
showGrid?
optionalshowGrid?:boolean
Defined in: react/src/hooks/use-chart.ts:39
width?
optionalwidth?:number
Defined in: react/src/hooks/use-chart.ts:37