@reincharts/annotations

Reference lines and areas, markers, labels, watermarks.

npm install @reincharts/annotations

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

Components

NameDescription
LabelText (and/or an SVG path) at a data or pixel position.
MarkersSeries markers above / below / in bars or at a price: arrows, shapes, flags, custom paths and text.
ReferenceAreaA highlighted rectangle / band between x and / or y values (ranges, sessions, target zones).
ReferenceDotA dot at a data point with an optional label above it (highlights, peaks, events).
ReferenceLineA horizontal (y) or vertical (x) reference line with an optional label (thresholds, targets, events).
WatermarkBig faint text behind the series (e.g.

Functions

NameDescription
addShapeAdds a marker shape of size s centered at (cx, cy) to a path.
fromEdgeResolves a pixel coordinate: negative values count from the far edge.
indexOfIndex of the datum nearest to a data x value, or -1.
logicalOfLogical x of a data x value (works in index and linear modes, extrapolates beyond the data).
pixelXPlot-relative pixel x of a data x value.
svgPathParsed (cached) Path2D of an SVG path string.

Types

NameDescription
AnnotationShape
DataXA data x value: a Date / timestamp, a number (linear x or numeric data) or a category name.
LabelPropsProps of the Label component.
MarkerItemOne explicit marker placed by data x.
MarkerPosition
MarkersPropsProps of the Markers component.
ReferenceAreaPropsProps of the ReferenceArea component.
ReferenceDotPropsProps of the ReferenceDot component.
ReferenceLinePropsProps of the ReferenceLine component.
ResolvedMarkerA marker resolved to pixels (passed to onClick).
WatermarkPropsProps of the Watermark component.

On this page