OptionalchartStyle of the main price series. Default: 'candles'.
DOM element to mount the three canvas layers into.
OptionalcrosshairCrosshair mode ('normal' / 'magnet'). Default: 'normal'.
OptionalhorzHorizontal-domain behavior controlling X-axis labels (time / price /
custom). Default: time. Use PriceScaleBehavior for options-style
numeric (strike) axes.
OptionallocaleBCP-47 locale (e.g. 'de-DE', 'ja-JP') for i18n (C6). When set, axis
numbers/dates, the legend, the crosshair pills, and screen-reader
announcements are formatted via Intl for this locale. Omit for the
locale-agnostic defaults (byte-for-byte identical to pre-C6). A
host-supplied priceFormat / volumeFormat still takes priority over the
locale-aware number formatting.
OptionalmaxCap on the number of candles retained in the buffer. When live updates
push the length past this, the oldest candles are evicted (O(1)) and
the viewport + drawings shift to stay anchored to the same candles.
Bounds memory for long-running live charts. Omit for unlimited.
History prepended via prependHistory is never auto-evicted.
Eviction is suspended while a replay session is active (the replay cap is
an absolute index that head-eviction would desync), so the buffer may
temporarily exceed maxCandles during a long replay and is trimmed back
on the first live append after stopReplay().
OptionalmessagesTranslatable UI string overrides (C6). Patches any subset of
Messages — aria-label, the OHLC announcement words, the
O/H/L/C/V legend letters, the "Go to live" pill — falling back to the
English DEFAULT_MESSAGES for the rest. Independent of locale:
you can translate strings without switching number/date formatting, or
vice-versa.
OptionalonCalled once for each price alert (C3) that fires on a realtime close-price
tick. The alert is one-shot — it is already active: false when this
callback runs, so it won't fire again until re-armed. Use it to surface a
toast/sound/notification. Add alerts via chart.addAlert(...).
OptionalonOptionalonCalled on a double-click over the plot area with the HoverInfo for
the cursor position (or null if the cursor is outside the plot). This
is purely additive — the chart's built-in double-click behavior
(fit-visible in the chart area, reset price scale over the axis) still
runs independently.
OptionalonCalled whenever the chart encounters a non-fatal or fatal error in its
data/render pipeline. If omitted, errors fall back to console.warn
via the default ErrorReporter.
OptionalonCalled on every crosshair move with the currently-snapped candle.
OptionalonCalled when the user pans into the left edge of the buffer. Lets hosts
implement virtual scroll by fetching older candles and calling
chart.prependHistory(olderCandles). The chart serializes calls — only
one load-more request is in flight at a time.
OptionalonCalled on every replay-mode (C1) index change with the last-revealed bar
index and whether playback is running. Fires on startReplay,
stepReplay, seekReplay, each play tick, and stopReplay. Use it to
drive a scrubber / play-pause UI. Omit if you don't use replay mode.
OptionalonOptionalpriceCustom price formatter. Default: 2 decimal places.
OptionalpriceInitial price-axis scale mode. Default: 'linear'.
Initial resolution (e.g. '1m', '15m', '1H', '1D').
Initial symbol identifier passed to the transport.
OptionalthemeTheme mode ('dark' / 'light' / 'auto') or explicit colors.
OptionaltransportOptional live data source. When omitted, feed candles via setData.
OptionalvolumeCustom volume formatter. Default: short K/M/B suffixes.
Construction-time configuration for an
OHLCVChart. All fields exceptcontainer,symbol, andresolutionare optional and have sensible defaults.Later lifecycle changes should go through the imperative methods (
setTheme,setChartType,setIndicatorConfigs, etc.) rather than rebuilding the config — the chart manages its own state internally.