Chartsv26.10.18
API reference

API overview

The main objects of the public API - renderer, series, scales and the React and element entry points.

This page covers the shape of the public API: which objects most integrations touch, what the frame object carries and where the generated reference lives.

The public surface is intentionally small. Most integrations touch only UnifinChart (React) or <unifin-chart> (HTML); direct core usage drives the renderer with a frame object.

Generated references: Core, Indicators, React, Element, Bonds kit, Portfolio kit, Options kit, Swaps kit.

Core objects (@unifin/chart-core)

ObjectPurposeKey members
Canvas2DRendererPaints one framerender(context, frame)
SeriesBar storage for one symbol and timeframesetHistory, toArray, length
TimeScaleHorizontal mapping and visible rangesetBarCount, setVisibleRange, scrollToLastBar
PriceScaleVertical mapping and price modessetHeight, fitContent
SERIES_RENDER_TYPESRuntime list of the 23 series identifiers-

Frame object

renderer.render(context, {
  bars,                 // readonly Bar[]
  width, height,        // canvas size in CSS pixels
  timeScale, priceScale,
  theme,                // DARK_THEME | LIGHT_THEME | ORANGE_THEME | systemTheme(prefersLight)
  priceAxisWidth,       // 0 hides the axis
  renderProfile,        // 'sparkline' | 'mini' | 'standard' | 'terminal'
  seriesType,           // one of SERIES_RENDER_TYPES
  instrument, timeframe, locale,
  crosshair,            // optional { index, price }
  overlays,             // optional host-computed indicator lines
  footprint,            // optional cluster data for the footprint series
});

React (@unifin/chart-react)

UnifinChart props:

PropTypeNotes
symbol, timeframe, barsrequiredBar[] with time, OHLC and volume
instrumentInstrumentTick step, digits, currency
theme, localetheme object / 'en' | 'ru'Dark theme and 'en' are typical
seriesTypeSeriesRenderTypeDefaults to candles
height, priceAxisWidth, showGridnumbers / booleanLayout knobs
mode'chart' | 'mini' | 'sparkline'Presentation role
overlaysLineOverlay[]Indicator curves and level lines
tooltip, tooltipHoldboolean / millisecondsHover card and its hold window (default 5000 ms)
ariaLabel, className, onReady-Accessibility and lifecycle

Also exported: Sparkline, MiniChart, ChartGrid, createSyncGroup, useChart, and the UI kit (UiButton, UiInput, UiSelect, UiDialog, UiMenu, UiTooltip, ensureUiStyles).

Custom element (@unifin/chart-element)

Attributes: symbol, timeframe, theme (dark | light | corporate | capitalMarkets | orange | unifin | system), series-type, scene, mini, renko-brick, show-grid, price-axis-width, tick-step, crosshair, readout-mode, crosshair-time, tooltip, tooltip-hold (hover-card hold in ms, default 5000). Methods: setScene, replayPlay/replayPause/replaySeek/replayExit, fibonacciEnable, setBarSpacing/zoomBy/resetView, setStop/setTake/setOrderLine (draggable trading lines with a version journal), yForPrice. Events: unifin-ready, scene:change, replay:progress, view:change, crosshair-move, crosshair-leave, bar-click, stop:dragstart/stop:drag/stop:change, order:dragstart/order:drag/order:change. Properties: bars, chart (binding), canvasElement. Register with defineUnifinChart().

Interactive chart

The same configuration rendered on this page:

This page is a curated overview. A fully generated reference for every exported symbol follows below; llms-full.txt contains the complete documentation text for assistant-assisted lookups.

Generated reference

The four pages below are generated from the package entries themselves (TypeScript compiler API, JSDoc first paragraphs, source order). They are rebuilt on every portal build, so they always match the shipped code.

PagePackageContents
Core@unifin/chart-coreRenderer, data layer, scales, drawing, profiles, alerts, trading models
Indicators@unifin/chart-indicatorsThe 128-indicator catalogue and the study engines
React@unifin/chart-reactComponents, hooks, binding, editions (light, standard, pro)
Element@unifin/chart-elementThe <unifin-chart> custom element and its registration

See also

On this page