Functions

Functions exported by @reincharts/coordinates.

import { axesOf, axisBand, axisLabelHeight, ... } from "@reincharts/coordinates";

axesOf

Price axes registered for a scale of a pane.

function axesOf(engine: ChartEngine, paneId: string, scaleId?: string): AxisRegistration[]

axisBand

Left edge and width of a price axis band relative to the pane plot origin (use plotOrigin = layout.plotLeft for whole-canvas coordinates).

function axisBand(
    layout: Layout,
    side: "left" | "right",
    plotOrigin?: number,
): { left: number; width: number; }

axisLabelHeight

Height in pixels of a price axis label box for a theme.

function axisLabelHeight(theme: Theme): number

crosshairPoint

Computes where the crosshair lines go: snapped to the bar center in index mode (including empty future slots for time data), free in linear mode, magnet-snapped vertically.

function crosshairPoint(
    engine: ChartEngine,
    c: CrosshairState,
    { mode, snapX, scale, formatX }?: Pick<CrosshairProps, "mode" | "snapX" | "scale" | "formatX">,
): CrosshairPoint

drawAxisLabel

Draws a label filling the price axis band at a y. Returns the label box.

function drawAxisLabel(
    ctx: CanvasRenderingContext2D,
    o: AxisLabelOptions,
): { top: number; height: number; }

drawValueMarkers

Draws price lines / axis labels for one price scale of a pane (ctx at the pane plot origin, unclipped). Axis labels on the same side are pushed apart so they never overlap.

function drawValueMarkers(
    ctx: CanvasRenderingContext2D,
    scope: DrawScope,
    scaleId: string,
    markers: readonly ValueMarker[],
): void

lastValues

Last values of every visible series in a pane (renderables implementing lastValue()), in z order.

function lastValues(engine: ChartEngine, paneId: string): LastValueEntry[]

On this page