@reincharts/series
Chart types: line, area, bars, scatter, candlesticks and more.
npm install @reincharts/seriesEverything here is also re-exported by the umbrella package reincharts.
Components
| Name | Description |
|---|---|
| AreaSeries | A line with a filled area below it (gradient by default). |
| BarSeries | Vertical bars from a base value (histograms, column charts, MACD histograms...). |
| BaselineSeries | A line whose fill and color switch between two colors above / below a base value. |
| BubbleSeries | Scatter plot whose marker area is proportional to a third value (r). |
| CandlestickSeries | Candlesticks (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. |
| ErrorBarSeries | Vertical error bars (whiskers) around a value. |
| GroupedBarSeries | Several bars side by side per x slot (category or bar). |
| GroupedHorizontalBarSeries | Grouped horizontal bars: ys holds one accessor per bar of a category (see HorizontalBarSeries for the setup). |
| HLCAreaSeries | HLC area: a high–low band split by the close line into an upper and a lower fill. |
| HorizontalBarSeries | Horizontal bars. |
| KagiSeries | Kagi chart: thick yang and thin yin lines that switch when a line breaks the previous peak / trough. |
| LineBreakSeries | Line break (three line break) boxes: one box per datum of the line break transform. |
| LineSeries | A line through one value per bar (also step lines and smooth monotone splines). |
| OHLCSeries | OHLC bars: a vertical high–low line with an open tick on the left and a close tick on the right (or HLC bars). |
| OverlayBarSeries | Several bars drawn over each other from the same base, largest at the back. |
| PointAndFigureSeries | Point & figure chart: columns of X (rising) and O (falling) boxes. |
| RenkoSeries | Renko bricks: fixed-size boxes stacked diagonally, one per datum of the renko transform. |
| ScatterSeries | Markers at (x, y) per datum: scatter plots (works with unsorted data in xMode="linear"), dot plots and indicator dots such as Parabolic SAR. |
| StackedAreaSeries | Areas stacked on top of each other (or normalised to 100% with offset="percent"). |
| StackedBarSeries | Bars stacked on top of each other per x slot (negative values stack downwards). |
| StackedHorizontalBarSeries | Stacked horizontal bars: ys holds one accessor per segment (see HorizontalBarSeries for the setup). |
| StraightLine | A horizontal or vertical reference line across the pane (thresholds, targets, overbought / oversold levels). |
| VolumeCandlesSeries | Candles whose color intensity and / or body width reflect the bar's volume relative to the visible bars. |
| VolumeProfileSeries | Volume profile: a horizontal histogram of traded volume by price over the visible bars (or per session), split up / down. |
| VolumeSeries | Volume histogram colored by candle direction. |
Hooks
| Name | Description |
|---|---|
| useSeries | Wires a series into the chart: drawing, autoscale, legend, snapping, last value and percent base. |
Classes
| Name | Description |
|---|---|
| PathBatch | Batches sub-paths by color so each color is filled / stroked once per frame. |
Functions
| Name | Description |
|---|---|
| addColumn | Adds a pixel-aligned vertical bar (centred on cx, spanning y1..y2) to a path. |
| addRow | Adds a pixel-aligned horizontal bar (spanning x1..x2, centred on cy) to a path. |
| areaFill | Resolves an area's fill (solid color or vertical gradient). |
| barLeft | Left pixel edge of a bar of integer width centred on cx, aligned to the pixel grid. |
| barWidth | Integer bar width for a bar spacing: ratio of the spacing, at least 1px, at most max. |
| drawMarker | Draws one marker immediately (convenience for annotations; series batch with traceMarker). |
| drawOhlcColumns | Draws 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. |
| formatValue | Plain number formatting for values on a non-price axis (horizontal bars). |
| getLod | The cached LOD index of data for a low / high accessor pair (the same function twice for a single value). |
| groupLayout | Splits a slot of slot pixels into count side-by-side bars separated by gap pixels. |
| linePoints | Collects [x, y] pixel points for bars start..end (null for gaps). |
| lodExtent | Exact [min, max] over bars start..end: whole blocks from the index, partial blocks bar by bar. |
| ohlcExtent | Fast autoscale for OHLC data: min low / max high (block index for large data, no per-bar allocations). |
| paletteColor | Palette color for value k. |
| pixelSpan | Rounded [start, size] of the span between two pixel positions (size at least min). |
| resolveColor | Resolves a BarColor (static or per bar) for a datum, falling back to theme.line. |
| stack | Stacks several values per datum. |
| stackAt | Stacks the values of one datum, calling emit(keyIndex, [y0, y1]) per key (used per frame by series). |
| toArray | Normalizes SeriesValues (one value, several or none) to an array. |
| traceArea | Traces closed area shapes between a top line and a bottom line (or a constant bottom y). |
| traceMarker | Adds a closed marker sub-path centred on (x, y) to a path or context. |
| tracePath | Traces a path through points into ctx (shared by line and area series). |
| verticalGradient | A vertical linear gradient between two colors over [y0, y1]. |
| volumeProfile | Buckets the volume of bars start..end into bins price rows. |
Constants
| Name | Description |
|---|---|
| LOD_BLOCK | Number of bars per block of the level-of-detail index. |
| LOD_MIN_LENGTH | Series shorter than this are always scanned bar by bar. |
Types
| Name | Description |
|---|---|
| AreaSeriesProps | Props of the AreaSeries component. |
| BarColor | A static color or a function of the datum (and theme), e.g. |
| BarLayout | |
| BarSeriesProps | Props of the BarSeries component. |
| BarStyleProps | Props shared by every bar series. |
| BaselineSeriesProps | Props of the BaselineSeries component. |
| BrickDatum | A brick / box produced by the renko or line break transforms (one datum per brick): `{ date, open, close, fullyFormed? |
| BubbleSeriesProps | Props of the BubbleSeries component. |
| CandlestickSeriesProps | Props of the CandlestickSeries component. |
| ColumnsSeriesProps | Props of the ColumnsSeries component. |
| Curve | Line interpolation between points. |
| ErrorBarSeriesProps | Props of the ErrorBarSeries component. |
| GroupedBarSeriesProps | Props of the GroupedBarSeries component. |
| HLCAreaSeriesProps | Props of the HLCAreaSeries component. |
| HorizontalBarSeriesProps | Props of the HorizontalBarSeries component. |
| KagiDatum | One vertical kagi line, as produced by the kagi transform. |
| KagiSeriesProps | Props of the KagiSeries component. |
| KagiType | |
| LegendHelpers | Passed to legendValues. |
| LineBreakSeriesProps | Props of the LineBreakSeries component. |
| LineSeriesProps | Props of the LineSeries component. |
| Lod | Level-of-detail index for large series: min / max (and their indices) plus the first / last valid index of every block of BLOCK bars. |
| MarkerShape | Marker shapes for scatter / bubble series, SAR dots and annotations. |
| MarkerStyle | |
| MultiBarProps | |
| OHLCAccessors | |
| OHLCSeriesProps | Props of the OHLCSeries component. |
| OverlayBarSeriesProps | Props of the OverlayBarSeries component. |
| Point | |
| PointAndFigureDatum | One point & figure column, as produced by the point & figure transform. |
| PointAndFigureSeriesProps | Props of the PointAndFigureSeries component. |
| ProfileRow | |
| RenkoSeriesProps | Props of the RenkoSeries component. |
| ScatterSeriesProps | Props of the ScatterSeries component. |
| SeriesProps | Props shared by every series. |
| SeriesValues | |
| StackedAreaSeriesProps | Props of the StackedAreaSeries component. |
| StackedBarSeriesProps | Props of the StackedBarSeries component. |
| StackedValue | Lower / upper value of one stacked item. |
| StackOptions | |
| StraightLineProps | Props of the StraightLine component. |
| UseSeriesOptions | |
| VolumeCandlesSeriesProps | Props of the VolumeCandlesSeries component. |
| VolumeProfileSeriesProps | Props of the VolumeProfileSeries component. |
| VolumeSeriesProps | Props of the VolumeSeries component. |