The chart createChart returned
Titles, labels, live and highlight settings
A handle to refresh or dispose the binding
import { CandlestickSeries, createChart, HistogramSeries } from 'lightweight-charts';
import { bindLightweightChart } from 'maidr/lightweight-charts';
const chart = createChart(document.getElementById('chart'), { height: 400 });
const candles = chart.addSeries(CandlestickSeries, { title: 'BTC-USD' });
const volume = chart.addSeries(HistogramSeries, { title: 'Volume' }, 1);
candles.setData(ohlc);
volume.setData(volumes);
const binding = bindLightweightChart(chart, { title: 'BTC-USD, 1 minute' });
// Streaming: every series.update(...) now reaches MAIDR on its own.
// Later: binding.dispose();
Binds MAIDR to a Lightweight Charts chart: reads its panes and series, mounts the accessible interface, highlights the reader's bar over the canvas, and follows the chart's data as it changes.
Call it once the series have data. The chart's container -- the element passed to
createChart-- must be in the document.