ChartOptions
Documentation / @elitechart/core / ChartOptions
Defined in: options.ts:29
Chart creation options. Pass to createChart as the second argument.
Example
Properties
contextMenu?
Defined in: options.ts:55
Show the right-click context menu on drawings. Defaults to true.
Menu items: Duplicate, Bring to front, Send to back, Lock/Unlock, Delete.
floatingToolbar?
Defined in: options.ts:50
Show the per-drawing floating toolbar when a drawing is selected.
Defaults to true. Set false to opt out (e.g. when the embedding app
provides its own drawing chrome).
initialVisibleBars?
Defined in: options.ts:40
Number of bars visible at startup, counted from the most recent.
Defaults to min(120, bars.length).
kind?
Defined in: options.ts:33
How to visualize the series. Defaults to 'candle'.
magnet?
Defined in: options.ts:80
Magnet mode — snap crosshair + drawing anchors to the nearest OHLC
value. Defaults to 'off'.
'off'— no snapping, pointer used as-is.'weak'— snap only when the pointer is within ~10 px of an OHLC value.'strong'— always snap to the closest OHLC value on the nearest bar.
onError?
Defined in: options.ts:101
Error hook for listener exceptions. Defaults to console.error.
Parameters
err
unknown
context
string
Returns
void
onReady?
Defined in: options.ts:99
Called once when the chart is fully initialised.
Returns
void
onRequestHistory?
Defined in: options.ts:97
Invoked when the user pans past the first bar in the series. The
embedder fetches more historical bars from its datafeed and calls
chart.setSeries(...) with the extended range. Debounced so rapid
pans fire once.
When omitted, panning past the first bar just shows empty space — the viewport continues to shift but no data loads.
Parameters
arg
earliestLoadedTime
Returns
void
persistentTool?
Defined in: options.ts:87
When true, drawing tools stay active after placement so the user can
drop multiple instances without re-clicking the toolbar. Commonly
exposed as a "stay in drawing mode" / pin affordance. Defaults to
false.
pricePadFraction?
Defined in: options.ts:44
Fractional padding above/below the visible price range. Defaults to 0.08 (8%).
priceScale?
Defined in: options.ts:35
Price-axis scaling. Defaults to 'linear'.
series
Defined in: options.ts:31
The initial series to render.
showOhlcvLegend?
Defined in: options.ts:71
Paint the canvas-side OHLCV legend (the small O … H … L … C … V
string at the chart's top-left, updated to follow the crosshair).
Defaults to true. Set false when the embedder ships its own
symbol/price/OHLCV header (e.g. EliteChart's <HeroPrice />)
to avoid duplicate paint paths for the same data.
theme?
Defined in: options.ts:42
Theme to apply on mount. Defaults to the built-in dark fallback.
useInternalDialogs?
Defined in: options.ts:63
Open the built-in AlertsDialog and SettingsDialog when "Manage
alerts…" / "Settings…" are picked from the chart-context menu.
Defaults to true. Set false when the embedder ships richer
replacements and wants to react to the chart-context:manage-alerts
/ chart-context:settings events directly.