The name rendererKind shipped under; the same value.
The render backend the chart is painting series with right now: what the
first pane was given, which is the renderer option unless its factory
declined (no WebGL2 on this device) and the 2D backend stood in, and
canvas2d from the moment a GPU backend degrades ('renderer:fallback').
The keyboard shortcut manager (null when shortcuts are disabled).
The data-driven trading layer: push positions/orders/trades and the chart
renders pills + markers, emitting trading:* events on interaction. Created
on first access.
Add an earnings/dividend/split event-marker strip to a pane.
Add a registered indicator. Built-in descriptors live in the lazy
openalgo-charts/indicators tier — import it (or register your own with
registerIndicator) before calling this.
'onchart' indicators overlay the price pane; 'pane' indicators get a new
pane of their own unless paneIndex says otherwise. The returned handle
recomputes automatically whenever the source data changes.
import 'openalgo-charts/indicators';
const macd = chart.addIndicator('macd', { fastPeriod: 8 });
macd.setSettings({ fastPeriod: 12 });
macd.remove();
Add a horizontal price line (order/SL/TP/alert/level) to a pane.
Public: attach any primitive (indicators, profiles, custom overlays) to a pane.
Add a series and return its data handle.
Apply a subset of chart options at runtime (theme, grid, formatters, crosshair mode) without recreating the chart.
The axis-chrome switches as they stand.
Arm the next plot click to answer with a price or a bar time, handed to
cb. Returns a cancel function; arming another pick on this chart cancels
the pending one. pick:start and pick:end bracket it so a host can show
its own cursor while the pick is live. See input/pick for why this does
not touch placement mode.
Host branding options, excluded from saved chart state.
The Canvas option block as it stands (theme fallbacks are not folded in).
Composite the full chart (all panes + overlays) and trigger a PNG download. This is what the screenshot keyboard shortcut runs; call it from a toolbar button for a reliable "save image" — the browser's native right-click "Save image as…" captures only the topmost (transparent overlay) canvas.
The chart as a standalone SVG document: every pane's base and overlay paint, in the order the DOM stacks them, run once into a serialising context at pixel ratio 1. Text stays text (selectable, searchable) and lines stay lines, so the file scales without the blur a PNG picks up.
Nothing transient is in it: no crosshair, no hover state, no drag. What is
in it is exactly what the renderers, primitives and drawing tools draw,
because it is the same code drawing. A primitive that paints through a
call with no vector form (a bitmap logo, a shadow) is simply thinner in
the export; see SvgContext for the list.
Returns the string only. Saving it is the host's job, the way
downloadScreenshot is the host-facing half of takeScreenshot:
new Blob([svg], { type: 'image/svg+xml' }) and an anchor is all it takes.
Optional instrument identity supplied by the host, never inferred from bars.
Capture the chart's serialisable state: viewport, grid, crosshair mode,
pane weights and price scales, indicator instances, and a drawings slot
the drawing tier fills. JSON-safe.
Series data is not captured — the app owns that (it knows the symbol, the timeframe, and the feed). Series descriptors are, so an app that rebuilds its own series can re-apply their styling and placement.
The current visible logical range.
Current grid options, visibility first (it is the one field always set).
Every live indicator instance, in the order they were added.
Flushes any pending recompute first. Indicator maths is deferred to the frame, so a caller that updates a bar and reads a value back in the same turn would otherwise see the previous tick's numbers.
Move a pane's price axis to the other strip, taking the series that map to
it and everything the axis was set to. Returns false when that side carries
nothing, or when the other side is already occupied: one strip draws one
axis (see Pane.moveSeriesScale), which is what movable reports.
Current navigation preferences, safe to save as JSON.
State of one price axis, for a host rendering a menu over it: what is currently on, and which items are worth offering. Null for a pane that does not exist.
active false is a scale no series maps to: the ladder on an empty chart,
or the side a menu was raised on before anything was plotted there. That is
a row to render disabled with its state visible, not one to leave out.
The primary pane's price-scale options (what the Scales tab reads).
Map a price to a container-relative Y in media (CSS) px, for positioning DOM
overlays (order panels, tooltips) over a pane. Returns null if the pane
doesn't exist. The inverse is coordinateToPrice.
Type and live style of the primary series, for a settings dialog: the type
decides which controls apply (a candle has borders, a line has a dash), and
the style is the object applyOptions patches.
Remove a pane, everything drawn in it, and any indicator that lives there. Pane 0 (price) is never removable — removing it would leave the chart with no time axis owner.
Returns false when the index is out of range or is pane 0.
Remove a primitive from whichever pane holds it.
Re-apply a state captured by getState. Restores grid, crosshair mode,
pane weights and price scales, indicators, and the viewport — everything
the chart is the source of truth for.
It does not recreate series: the chart has no way to know their data.
The returned report lists the series descriptors it saw so the caller can
rebuild them (addSeries(s.type, { paneIndex: s.paneIndex, style: s.style }))
and then feed them.
Restore the viewport after your data lands — logical ranges index bars, so
a range applied to an empty chart means nothing. Call restoreState again
(or setVisibleLogicalRange) once the series are populated.
Turn the axis-strip chrome on or off, and hand it a clock. Merges field by field, so switching the countdown on leaves the corner clock alone.
Replace chart-owned branding. Manually attached primitives are independent.
The Canvas option block (grid, crosshair, scale text/lines, plot margins). Each sub-block merges field by field, so setting one grid colour leaves the rest of the grid alone.
Clear the previous source bars before changing context, then load the new source.
Turn event types on/off. Unlisted types stay visible.
Hand the chart the corporate-action / news calendar and let it own the
strip. The difference from addEventMarkers is who filters: holding the
full list here is what lets setEventOptions (the settings dialog's Events
switches) turn a type off and back on without the host re-supplying data.
Grid lines at runtime: visibility of each axis, plus its colour, dash, width and spacing. Omitted fields keep their current value. Repaints every pane.
A new default bar count immediately restores that view without dropping history.
Turn pointer gestures into anchor placement instead of panning. A host arms
this while a drawing tool is active: a press no longer scrolls the chart, and
a press-drag-release is reported as two click events (press point, then
release point, the latter tagged viaDrag) so a two-point shape can be drawn
in one gesture. DrawingController drives this for you.
Auto-fit one axis: its range tracks the data again, or stays where the user
left it. Turning it on releases any ratio lock on that axis, for the reason
given in setAutoScale.
Pin one axis' price-per-bar ratio: zooming the time axis then rescales the prices with it, so a trend drawn at 45 degrees stays at 45 degrees. The axis goes manual, because auto-fit would re-fit the data every frame and undo the ratio being held.
Returns whether the axis is now in the state asked for. Locking fails on a scale nothing has measured: there is no ratio to hold on an empty pane, or on one whose series plot no values at all.
Options for one pane's scale (mode, invert, tick size, margins) rather than every pane's. The four modes are one field, so picking one drops the previous by construction: a menu renders them as a single choice.
Set a custom price formatter for every pane's axis labels, last-price tag, and price-line labels at runtime (e.g. switch to a currency format). Pass null to restore the default tick-size-aware formatting.
Price-scale options for every pane (mode, inverted, tick size, margins), and the default new panes inherit.
scope says how far a chart-wide setting reaches:
'primary' (default): each pane's right scale only. A mode change
wants this: rebasing a volume overlay quotes percent change in lots.'axes': every scale that draws a ladder, so the left axis moves with
the right. Plot margins want this.'all': the hidden overlay scales too. Almost nothing should: an
overlay's margins are its creator's placement, see Pane.axisScales.minMove is the one field no scope carries onto a pane that does not quote
the instrument, whichever scope is asked for: see _scalePatchFor. Every
other field is a property of the axis and reaches exactly as far as scope
says.
Per-field status-line switches, applied to every pane legend on the chart: the host's symbol row and the indicator rows alike, which is what makes one switch mean the same thing everywhere. Merges field by field.
Swap the palette at runtime (dark/light toggle) without recreating the chart.
Set a custom time-axis + crosshair label formatter (UTC seconds -> string) at runtime. Pass undefined to restore the IST default.
Change the zone the time axis and crosshair label in, without rebuilding the chart: a terminal switching from an NSE symbol to a US one needs exactly this. Throws on a name the runtime does not recognise, rather than quietly labelling in the old zone, because a chart showing the wrong hours is the kind of wrong nobody notices until it costs money.
Recolour the trade layer. Safe before it exists: the patch is held and
handed over the moment chart.trading builds the controller.
Restore a saved logical range (e.g. preserve the user's zoom across a data reload).
Patch background text preferences. Boolean input changes visibility only.
Subscribe to crosshair movement for an OHLC legend / tooltip. The callback fires with the hovered bar of the primary price series on every move, and with all-null fields when the pointer leaves the plot.
Subscribe to drags of draggable primitives (order / SL / TP lines, drawing handles). Fires per move and on release.
time is the UTC seconds under the cursor, interpolated between bars and
extrapolated past the right edge — so a two-axis drag (a trendline endpoint,
a projection) has a usable time even where the gapless axis has no bar.
Price-only consumers can simply ignore it.
OptionalonDragEnd: (externalId: string, price: number, time: number) => voidFlatten every pane's base + overlay canvas into one opaque canvas (device px). The chart renders as stacked layered canvases, so the browser's native right-click "Save image" only captures the layer under the pointer (usually the transparent crosshair overlay) — use this to export the full chart.
The active palette. Swap it with setTheme.
A host for the (lazy-loaded) trade layer to attach/detach its primitives on a pane.
Trade-layer colours, whether or not the controller has been created. Once
it exists it is the single answer (a host may set colours on it directly);
before that, the held patch is folded onto the defaults. The fold is needed
because the two shapes name a colour differently: the patch says
longColor, the resolved palette says long.
JSON-safe preferences. Automatic text remains blank in this snapshot.
True once
destroy()has run. Anything holding a chart it did not create (a link group, a controller, a host cache) needs to know the object is a corpse before it calls into it: inferring it from a side effect such as an empty pane list works only for as long as nothing else can empty one.