@reincharts/series

Chart types: line, area, bars, scatter, candlesticks and more.

npm install @reincharts/series

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

Components

NameDescription
AreaSeriesA line with a filled area below it (gradient by default).
BarSeriesVertical bars from a base value (histograms, column charts, MACD histograms...).
BaselineSeriesA line whose fill and color switch between two colors above / below a base value.
BubbleSeriesScatter plot whose marker area is proportional to a third value (r).
CandlestickSeriesCandlesticks (also hollow candles and Heikin Ashi data).
ColumnsSeries"Columns" chart type: a column per bar up to the close, colored by the change from the previous close.
ErrorBarSeriesVertical error bars (whiskers) around a value.
GroupedBarSeriesSeveral bars side by side per x slot (category or bar).
GroupedHorizontalBarSeriesGrouped horizontal bars: ys holds one accessor per bar of a category (see HorizontalBarSeries for the setup).
HLCAreaSeriesHLC area: a high–low band split by the close line into an upper and a lower fill.
HorizontalBarSeriesHorizontal bars.
KagiSeriesKagi chart: thick yang and thin yin lines that switch when a line breaks the previous peak / trough.
LineBreakSeriesLine break (three line break) boxes: one box per datum of the line break transform.
LineSeriesA line through one value per bar (also step lines and smooth monotone splines).
OHLCSeriesOHLC bars: a vertical high–low line with an open tick on the left and a close tick on the right (or HLC bars).
OverlayBarSeriesSeveral bars drawn over each other from the same base, largest at the back.
PointAndFigureSeriesPoint & figure chart: columns of X (rising) and O (falling) boxes.
RenkoSeriesRenko bricks: fixed-size boxes stacked diagonally, one per datum of the renko transform.
ScatterSeriesMarkers at (x, y) per datum: scatter plots (works with unsorted data in xMode="linear"), dot plots and indicator dots such as Parabolic SAR.
StackedAreaSeriesAreas stacked on top of each other (or normalised to 100% with offset="percent").
StackedBarSeriesBars stacked on top of each other per x slot (negative values stack downwards).
StackedHorizontalBarSeriesStacked horizontal bars: ys holds one accessor per segment (see HorizontalBarSeries for the setup).
StraightLineA horizontal or vertical reference line across the pane (thresholds, targets, overbought / oversold levels).
VolumeCandlesSeriesCandles whose color intensity and / or body width reflect the bar's volume relative to the visible bars.
VolumeProfileSeriesVolume profile: a horizontal histogram of traded volume by price over the visible bars (or per session), split up / down.
VolumeSeriesVolume histogram colored by candle direction.

Hooks

NameDescription
useSeriesWires a series into the chart: drawing, autoscale, legend, snapping, last value and percent base.

Classes

NameDescription
PathBatchBatches sub-paths by color so each color is filled / stroked once per frame.

Functions

NameDescription
addColumnAdds a pixel-aligned vertical bar (centred on cx, spanning y1..y2) to a path.
addRowAdds a pixel-aligned horizontal bar (spanning x1..x2, centred on cy) to a path.
areaFillResolves an area's fill (solid color or vertical gradient).
barLeftLeft pixel edge of a bar of integer width centred on cx, aligned to the pixel grid.
barWidthInteger bar width for a bar spacing: ratio of the spacing, at least 1px, at most max.
drawMarkerDraws one marker immediately (convenience for annotations; series batch with traceMarker).
drawOhlcColumnsDraws OHLC data with several bars per pixel: one aggregated bar per pixel column (first open, max high, min low, last close) as a 1px line, merging pre-aggregated blocks when a whole block shares a pixel.
formatValuePlain number formatting for values on a non-price axis (horizontal bars).
getLodThe cached LOD index of data for a low / high accessor pair (the same function twice for a single value).
groupLayoutSplits a slot of slot pixels into count side-by-side bars separated by gap pixels.
linePointsCollects [x, y] pixel points for bars start..end (null for gaps).
lodExtentExact [min, max] over bars start..end: whole blocks from the index, partial blocks bar by bar.
ohlcExtentFast autoscale for OHLC data: min low / max high (block index for large data, no per-bar allocations).
paletteColorPalette color for value k.
pixelSpanRounded [start, size] of the span between two pixel positions (size at least min).
resolveColorResolves a BarColor (static or per bar) for a datum, falling back to theme.line.
stackStacks several values per datum.
stackAtStacks the values of one datum, calling emit(keyIndex, [y0, y1]) per key (used per frame by series).
toArrayNormalizes SeriesValues (one value, several or none) to an array.
traceAreaTraces closed area shapes between a top line and a bottom line (or a constant bottom y).
traceMarkerAdds a closed marker sub-path centred on (x, y) to a path or context.
tracePathTraces a path through points into ctx (shared by line and area series).
verticalGradientA vertical linear gradient between two colors over [y0, y1].
volumeProfileBuckets the volume of bars start..end into bins price rows.

Constants

NameDescription
LOD_BLOCKNumber of bars per block of the level-of-detail index.
LOD_MIN_LENGTHSeries shorter than this are always scanned bar by bar.

Types

NameDescription
AreaSeriesPropsProps of the AreaSeries component.
BarColorA static color or a function of the datum (and theme), e.g.
BarLayout
BarSeriesPropsProps of the BarSeries component.
BarStylePropsProps shared by every bar series.
BaselineSeriesPropsProps of the BaselineSeries component.
BrickDatumA brick / box produced by the renko or line break transforms (one datum per brick): `{ date, open, close, fullyFormed?
BubbleSeriesPropsProps of the BubbleSeries component.
CandlestickSeriesPropsProps of the CandlestickSeries component.
ColumnsSeriesPropsProps of the ColumnsSeries component.
CurveLine interpolation between points.
ErrorBarSeriesPropsProps of the ErrorBarSeries component.
GroupedBarSeriesPropsProps of the GroupedBarSeries component.
HLCAreaSeriesPropsProps of the HLCAreaSeries component.
HorizontalBarSeriesPropsProps of the HorizontalBarSeries component.
KagiDatumOne vertical kagi line, as produced by the kagi transform.
KagiSeriesPropsProps of the KagiSeries component.
KagiType
LegendHelpersPassed to legendValues.
LineBreakSeriesPropsProps of the LineBreakSeries component.
LineSeriesPropsProps of the LineSeries component.
LodLevel-of-detail index for large series: min / max (and their indices) plus the first / last valid index of every block of BLOCK bars.
MarkerShapeMarker shapes for scatter / bubble series, SAR dots and annotations.
MarkerStyle
MultiBarProps
OHLCAccessors
OHLCSeriesPropsProps of the OHLCSeries component.
OverlayBarSeriesPropsProps of the OverlayBarSeries component.
Point
PointAndFigureDatumOne point & figure column, as produced by the point & figure transform.
PointAndFigureSeriesPropsProps of the PointAndFigureSeries component.
ProfileRow
RenkoSeriesPropsProps of the RenkoSeries component.
ScatterSeriesPropsProps of the ScatterSeries component.
SeriesPropsProps shared by every series.
SeriesValues
StackedAreaSeriesPropsProps of the StackedAreaSeries component.
StackedBarSeriesPropsProps of the StackedBarSeries component.
StackedValueLower / upper value of one stacked item.
StackOptions
StraightLinePropsProps of the StraightLine component.
UseSeriesOptions
VolumeCandlesSeriesPropsProps of the VolumeCandlesSeries component.
VolumeProfileSeriesPropsProps of the VolumeProfileSeries component.
VolumeSeriesPropsProps of the VolumeSeries component.

On this page