@reincharts/coordinates

Crosshair, last-value labels and price lines.

npm install @reincharts/coordinates

Everything here is also re-exported by the umbrella package reincharts.

Components

NameDescription
CrosshairCrosshair: dashed lines across all panes at the hovered bar and in the hovered pane at the pointer (or the magnet value), with labels on the time axis and on every price axis of the pane.
CurrentCoordinateA dot on a series at the hovered bar (follows the crosshair, also when synced from another chart).
EdgeIndicatorA price axis label (and optional line) for the first or last visible value of any accessor.
LastValueLabelColored labels with the last value of each series of the pane on the price axis.
LastValueLineLastValueLabel with a dotted line across the plot at each last value.
PriceLineA horizontal price line with an axis label and optional title.

Functions

NameDescription
axesOfPrice axes registered for a scale of a pane.
axisBandLeft edge and width of a price axis band relative to the pane plot origin (use plotOrigin = layout.plotLeft for whole-canvas coordinates).
axisLabelHeightHeight in pixels of a price axis label box for a theme.
crosshairPointComputes 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.
drawAxisLabelDraws a label filling the price axis band at a y.
drawValueMarkersDraws price lines / axis labels for one price scale of a pane (ctx at the pane plot origin, unclipped).
lastValuesLast values of every visible series in a pane (renderables implementing lastValue()), in z order.

Types

NameDescription
AxisLabelOptions
CrosshairMode
CrosshairPointResolved crosshair position in whole-canvas coordinates.
CrosshairPropsProps of the Crosshair component.
CurrentCoordinatePropsProps of the CurrentCoordinate component.
EdgeIndicatorPropsProps of the EdgeIndicator component.
LastValueEntry
LastValueLabelPropsProps of the LastValueLabel component.
PriceLinePropsProps of the PriceLine component.
ValueMarker

On this page