Watchlist

Open-source charting engine

Watchlist

Thirty pairs with a 24-hour sparkline each and prices that refresh every 2 seconds. The sparklines are charts from one pool sharing a GPU device, so a page of many small charts stays within the browser's limit of WebGL contexts.

Apache-2.0

Watchlist: Price action example

FerroChart.createPool · preset: 'sparkline' · theme object · addSeries('baseline')

Code
import { FerroChart } from '@ferrochart/core';

const canvas = document.querySelector('canvas');
// Market data: OKX spot (BTC, ETH, SOL against USDT) through the FerroChart demo API.
// A watchlist: 30 pairs, each row with a 24-hour sparkline. The sparklines
// come from one pool, so they share one GPU device (a page can hold only a
// few WebGL contexts); prices refresh every 2 seconds. A row opens its pair
// in the chart on the left.
const PAIRS = ['BTC', 'ETH', 'SOL', 'BNB', 'XRP', 'DOGE', 'ADA', 'AVAX', 'LINK', 'LTC', 'DOT', 'TRX', 'SHIB', 'BCH', 'NEAR',
  'UNI', 'APT', 'ATOM', 'ETC', 'FIL', 'ARB', 'OP', 'SUI', 'PEPE', 'ICP', 'XLM', 'HBAR', 'AAVE', 'INJ', 'WLD'];
const UP = '#2ee6b6', DOWN = '#ff5d73';
const digits = (p) => (p >= 100 ? 2 : p >= 1 ? 3 : p >= 0.01 ? 5 : 8);

// The list: right of the chart, or below it on a narrow screen.
const narrow = canvas.parentElement.clientWidth < 640;
const list = document.createElement('div');
list.style.cssText = 'position:absolute;overflow-y:auto;background:#0b0d12;font:500 13px system-ui;color:#e6e9ef;'
  + (narrow ? 'left:0;right:0;bottom:0;height:55%;border-top:1px solid #ffffff14' : 'top:0;right:0;bottom:0;width:min(360px,48%);border-left:1px solid #ffffff14');
if (narrow) canvas.style.height = '45%';
else canvas.style.width = 'calc(100% - min(360px, 48%))';
const title = document.createElement('div');
title.style.cssText = 'position:absolute;left:16px;top:12px;font:600 15px system-ui;color:#e6e9ef;pointer-events:none';
canvas.after(list, title);

const chart = await FerroChart.create(canvas, { theme: 'dark' });
const main = chart.addSeries('area', { color: '#4cc9f0', topFill: '#4cc9f055', bottomFill: '#4cc9f000', lineWidth: 2 });
async function open(sym) {
  const bars = await fetch(`/api/live/bars?symbol=${sym}USDT&interval=15m&count=672`).then((r) => r.json());
  main.applyOptions({ pricePrecision: digits(bars.close.at(-1)) });
  main.setData({ time: bars.time, value: bars.close });
  chart.fitContent();
  title.textContent = `${sym} / USDT · 15m`;
  for (const row of list.children) row.style.boxShadow = row.dataset.sym === sym ? 'inset 3px 0 #4cc9f0' : '';
}

const pool = await FerroChart.createPool();
const rows = new Map();
for (const sym of PAIRS) {
  const row = document.createElement('div');
  row.dataset.sym = sym;
  row.style.cssText = 'display:grid;grid-template-columns:64px 1fr 96px;align-items:center;gap:10px;padding:8px 14px;border-bottom:1px solid #ffffff0a;cursor:pointer';
  row.innerHTML = `<b>${sym}</b><canvas style="width:100%;height:36px"></canvas>
    <div style="text-align:right"><div class="p">—</div><div class="c" style="font-size:11px">—</div></div>`;
  row.onclick = () => open(sym);
  list.append(row);
  const spark = await pool.create(row.querySelector('canvas'), { preset: 'sparkline', theme: { base: 'dark', background: '#0b0d12' } });
  const s = spark.addSeries('baseline', { color: UP, downColor: DOWN, topFill: '#00000000', bottomFill: '#00000000', lineWidth: 1.5, lastValueVisible: false, priceLineVisible: false });
  rows.set(sym, { row, spark, s, last: null });
}

// One day of 5-minute closes per pair, against the price 24 hours ago.
await Promise.all(PAIRS.map(async (sym) => {
  const r = rows.get(sym);
  const bars = await fetch(`/api/live/bars?symbol=${sym}USDT&interval=5m&count=288`).then((res) => (res.ok ? res.json() : null));
  if (!bars) return;
  r.s.applyOptions({ baseValue: bars.open[0] });
  r.s.setData({ time: bars.time, value: bars.close });
  r.spark.fitContent();
  r.last = bars.time.at(-1);
}));

async function tick() {
  const quotes = await fetch(`/api/live/tickers?symbols=${PAIRS.map((p) => `${p}USDT`).join(',')}`).then((r) => r.json()).catch(() => []);
  for (const { symbol, price, ref } of quotes) {
    const r = rows.get(symbol.replace(/USDT$/, ''));
    if (!r) continue;
    const pct = (price / ref - 1) * 100;
    r.row.querySelector('.p').textContent = Number(price).toFixed(digits(price));
    const c = r.row.querySelector('.c');
    c.textContent = `${pct >= 0 ? '+' : ''}${pct.toFixed(2)}%`;
    c.style.color = pct >= 0 ? UP : DOWN;
    // The sparkline follows the price: the last 5-minute point, or a new one.
    if (r.last === null) continue;
    r.last = Math.max(r.last, Math.floor(Date.now() / 300_000) * 300_000);
    r.s.update({ time: r.last, value: Number(price) });
  }
}
await tick();
const timer = setInterval(tick, 2000);
await open('BTC');
const stop = () => clearInterval(timer); // then pool.destroy() and chart.destroy()

Built for tick-level data.

Apple M4 Max · Chrome + WebGPU

Load 1 million bars and draw the first frame in the browser

WASM · WebGPU

Load 10 million bars natively, level-of-detail pyramid included

native Rust

Heap allocations per frame while panning, zooming and streaming

steady state

WebAssembly package size, gzip

all features

Browser figures: Google Chrome with WebGPU; the 10 million bar load is native Rust. Bars show each figure against its target: 300 ms for a load, no allocations, 1.5 MB for the package.

Examples

313 examples
across 20 use cases.

Each example is a live chart rendered by FerroChart in your browser, with its source code alongside. All data is synthetic.

Bar replay
Real-time stream
Candlesticks + volume
01

Price action

25 examples →

Candles, bars and lines for any market, streaming in real time.

Depth heatmap
Delta footprint
Footprint
04

Order flow

20 examples →

Footprint, depth heatmap and market profile, on a compute-shader path.

Implied volatility · basis
Long/short ratio · CVD
Funding · open interest · liquidations
06

Crypto derivatives

15 examples →

Funding, open interest, liquidations and basis in panes under price.

Risk reversal · butterfly
Expected move to expiry
Implied vs realised vol · IV rank
12

Options & volatility

18 examples →

Implied against realised, skew, expected moves and dealer exposure in time.

Joint drawdowns
Underwater curve · worst drawdown
Equity curve · drawdown
16

Portfolio, risk & quant

24 examples →

Equity curves, drawdowns, rolling statistics, factor research and risk checks.

Grouped columns
Stacked columns
100% stacked area
19

Custom series & plugins

11 examples →

Stacked, grouped, box and brushed series: layer plugins on the same GPU frame.

Browse all 20 use cases

Price action

Bar types & transforms

Technical analysis

Order flow

Execution & trade review

Crypto derivatives

On-chain

DeFi & AMMs

Memecoins & wallets

Equities & fundamentals

China A-shares

Options & volatility

Rates, FX & macro

Futures & commodities

Funds & ETFs

Portfolio, risk & quant

Private markets & personal finance

Prediction markets

Custom series & plugins

Labs & flagships

Features

Designed for market data.

01

Cross-platform rendering

A single Rust core with WebGPU and WebGL2 backends in the browser, wgpu on Metal, Vulkan and DirectX 12 in native applications, and a CPU renderer for servers. Golden-image tests keep the backends consistent.

02

Performance independent of data size

Bar data stays on the GPU and coordinate transforms run in shaders, so panning and zooming update only a few uniforms. A level-of-detail pyramid keeps tens of millions of bars responsive.

03

30 built-in indicators

Moving averages, channels and oscillators from SMA to Ichimoku. Values are updated incrementally on each tick and tested against reference data.

04

29 drawing tools

Trend lines, channels, Fibonacci tools, pitchforks, Gann fans, patterns, Elliott waves, ranges, positions and text, with undo and redo. Drawings and chart state serialize to JSON.

05

Synchronized charts

Sync groups link the crosshair and the visible range across multiple charts.

06

Extensible

Plugin interfaces for custom series, layers and drawing tools. Bindings for JavaScript, Rust and Python, and a C ABI for C#, C++, Qt and Flutter.

Get started

One API in every language.

Every binding follows the same model: create a chart, add series, set data and add indicators. Data is passed as columns, from typed arrays, Rust slices or DataFrames.

  • JavaScript & TypeScript
  • Rust
  • Python & Jupyter
  • C, C#, C++
Read the documentation
main.js
$ npm install @ferrochart/core
import { FerroChart } from '@ferrochart/core';

const chart = await FerroChart.create(canvas, { theme: 'dark' });
const candles = chart.addCandlestickSeries();
chart.addVolumeSeries(candles);
candles.setData(bars); // [{ time, open, high, low, close, volume }, ...]
chart.addIndicator(candles, 'ema', { n: 20 });
chart.addIndicator(candles, 'macd'); // in a new pane

FerroChart

Every market.
Every screen.
One engine.

Open source under Apache-2.0, from the browser to the trading desk.