Framework-agnostic OHLCV (candlestick) chart library. Zero runtime dependencies. Canvas-based rendering. TypedArray buffers.
This is the core of the OpenKline monorepo. For framework wrappers see @rekurt/openkline-react and @rekurt/openkline-vue.
npm install @rekurt/openkline-core
import { OHLCVChart } from '@rekurt/openkline-core';
const chart = new OHLCVChart({
container: document.getElementById('chart')!,
symbol: 'BTC/USDT',
resolution: '1H',
theme: 'auto', // or 'dark' | 'light'
onError: (err) => console.error(err),
});
chart.setData([
{ o: 42000, h: 42100, l: 41900, c: 42050, v: 1_000, t: 1_700_000_000 },
// ...
]);
LineRenderer, AreaRenderer, OHLCBarRendererPane + PaneLayout (linear / log Y-axis per pane)SMA, EMA, BollingerBands, RSI — extend via the Indicator base classprefers-reduced-motion), smooth wheel zoom, trackpad horizontal swipe → panPollingTransport, WebSocketTransport (abstract base for custom WS adapters)onError callback and ErrorReportervalidateCandlesActive development. Core rendering, data, and interaction layers are stable with extensive unit tests (450+). Sub-pane indicators (RSI, MACD, Stochastic, ATR) render in their own stacked panes via the Pane/PaneLayout abstraction. Advanced drawing tools and a larger indicator catalog are on the roadmap.
MIT