Skip to content

Function: linkX()

ts
function linkX(plots): () => void;

Defined in: plot.ts:2819

Link the x-axis (pan / zoom) and hover crosshair of several plots so they move together — the standard multi-pane financial layout (price on top, volume / RSI / MACD below, all sharing one time axis). The plots should share the same x-scale semantics (e.g. all ordinal-time over the same bars).

ts
const detach = linkX([pricePlot, volumePlot, rsiPlot]);
// …later: detach();

Parameters

ParameterType
plotsPlot[]

Returns

a function that unlinks them again.

() => void

MIT licensed. WebGL2 required.