Skip to content
EliteChart

ChartProps

Documentation


Documentation / @elitechart/react / ChartProps

Defined in: react/src/types.ts:34

Props accepted by the <Chart /> component.

Mirrors ChartOptions from @elitechart/core minus the theme field (we expose theme directly so it can be a reactive prop) plus a handful of DOM-side knobs (className, style).

Example

code
<Chart
  series={series}
  kind="candle"
  theme={darkTheme}
  style={{ height: 480 }}
  onReady={(h) => console.log('ready', h)}
/>

Extends

Properties

className?

code
readonly optional className?: string;

Defined in: react/src/types.ts:38

Forwarded to the mount <div>.


contextMenu?

code
readonly optional contextMenu?: boolean;

Defined in: core/dist/index.d.ts:1552

Show the right-click context menu on drawings. Defaults to true. Menu items: Duplicate, Bring to front, Send to back, Lock/Unlock, Delete.

Inherited from

ChartOptions.contextMenu


floatingToolbar?

code
readonly optional floatingToolbar?: boolean;

Defined in: core/dist/index.d.ts:1547

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).

Inherited from

ChartOptions.floatingToolbar


initialVisibleBars?

code
readonly optional initialVisibleBars?: number;

Defined in: core/dist/index.d.ts:1537

Number of bars visible at startup, counted from the most recent. Defaults to min(120, bars.length).

Inherited from

ChartOptions.initialVisibleBars


kind?

code
readonly optional kind?: SeriesKind;

Defined in: core/dist/index.d.ts:1530

How to visualize the series. Defaults to 'candle'.

Inherited from

ChartOptions.kind


magnet?

code
readonly optional magnet?: "off" | "weak" | "strong";

Defined in: core/dist/index.d.ts:1577

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.

Inherited from

ChartOptions.magnet


onError?

code
readonly optional onError?: (err, context) => void;

Defined in: core/dist/index.d.ts:1600

Error hook for listener exceptions. Defaults to console.error.

Parameters

err

unknown

context

string

Returns

void

Inherited from

ChartOptions.onError


onReady?

code
readonly optional onReady?: (handle) => void;

Defined in: react/src/types.ts:47

Fires once the chart engine has fully booted and the first frame has painted. Receives the live ChartHandle so callers can imperatively drive the chart from the same render where the component mounts.

Parameters

handle

ChartHandle

Returns

void


onRequestHistory?

code
readonly optional onRequestHistory?: (arg) => void;

Defined in: core/dist/index.d.ts:1594

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

TimestampMs

Returns

void

Inherited from

ChartOptions.onRequestHistory


persistentTool?

code
readonly optional persistentTool?: boolean;

Defined in: core/dist/index.d.ts:1584

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.

Inherited from

ChartOptions.persistentTool


pricePadFraction?

code
readonly optional pricePadFraction?: number;

Defined in: core/dist/index.d.ts:1541

Fractional padding above/below the visible price range. Defaults to 0.08 (8%).

Inherited from

ChartOptions.pricePadFraction


priceScale?

code
readonly optional priceScale?: PriceScaleKind;

Defined in: core/dist/index.d.ts:1532

Price-axis scaling. Defaults to 'linear'.

Inherited from

ChartOptions.priceScale


series

code
readonly series: Series;

Defined in: core/dist/index.d.ts:1528

The initial series to render.

Inherited from

ChartOptions.series


showOhlcvLegend?

code
readonly optional showOhlcvLegend?: boolean;

Defined in: core/dist/index.d.ts:1568

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.

Inherited from

ChartOptions.showOhlcvLegend


style?

code
readonly optional style?: CSSProperties;

Defined in: react/src/types.ts:40

Forwarded to the mount <div>. Defaults to { width: '100%', height: '100%' }.


theme?

code
readonly optional theme?: ChartForgeTheme;

Defined in: react/src/types.ts:36

Optional initial theme. Defaults to the built-in dark fallback.


useInternalDialogs?

code
readonly optional useInternalDialogs?: boolean;

Defined in: core/dist/index.d.ts:1560

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.

Inherited from

ChartOptions.useInternalDialogs