interface Widget {
    alerts: AlertController;
    chart: Chart;
    context: WidgetContext;
    dataController: null | DataLoadingController;
    draw: DrawingController;
    drawingTemplates: null | DrawingTemplates;
    history: ChartHistory;
    instrumentDrawings: null | InstrumentDrawings;
    isDestroyed: boolean;
    layouts: null | LayoutsController;
    objects: ChartObjects;
    ready: Promise<void>;
    root: HTMLElement;
    series: SeriesApi;
    chartType(): string;
    destroy(): void;
    exchange(): string;
    getState(): WidgetState;
    goTo(target: DateNavigationTarget): Promise<DateNavigationResult>;
    interval(): string;
    off<K extends WidgetEventName>(
        event: K,
        cb?: (payload: WidgetBusEvents[K]) => void,
    ): void;
    on<K extends WidgetEventName>(
        event: K,
        cb: (payload: WidgetBusEvents[K]) => void,
    ): () => void;
    openAlerts(): boolean;
    openDataWindow(): boolean;
    openDateNavigation(): boolean;
    openIndicatorPicker(): boolean;
    openLayouts(): boolean;
    openNews(): boolean;
    openObjects(): boolean;
    openSettings(): boolean;
    openWatchlist(): boolean;
    range(): null | string;
    reload(): Promise<void>;
    restoreState(state: unknown): WidgetRestoreReport;
    setChartType(id: string): void;
    setDataVariant(variant: undefined | DataVariant): void;
    setInterval(code: string): void;
    setRange(id: string): Promise<DateNavigationResult>;
    setSymbol(symbol: string, exchange?: string): void;
    setTheme(theme: ChartTheme | WidgetThemeName): void;
    symbol(): string;
    theme(): WidgetThemeName;
    variant(): undefined | Readonly<DataVariant>;
}

Properties

chart: Chart
context: WidgetContext

What every mounted piece was handed; a host mounting its own panel wants the same.

dataController: null | DataLoadingController

Managed data owner, or null when the host supplies series data directly.

drawingTemplates: null | DrawingTemplates

The template store's catalog as the widget holds it, or null without a drawingTemplates store.

history: ChartHistory

One undo timeline for the chart: studies, their settings, the chart type, price scales, panes and drawings. Ctrl+Z, Ctrl+Y, the rail and the mobile controls all walk it. A host's own change that should not be a step goes through history.ignore; loading a layout with restoreState clears it.

instrumentDrawings: null | InstrumentDrawings

What keeps the drawings per instrument, or null in 'chart' scope. A host reads another instrument's drawings through it (document), or writes them now (save).

isDestroyed: boolean
layouts: null | LayoutsController

The controller behind the Layouts menu, or null without one (workspaces, layouts).

objects: ChartObjects

Shared inventory and supported actions for drawings, indicators and registered profiles.

ready: Promise<void>

Settles once the persisted layout has been applied and the first load has started (since 2.5.10). At once without persist or over a synchronous store; over an asynchronous one (IndexedDB, the default) when it has been read, and until then the widget stays out of sight and shows the defaults. Never rejects: a store that fails is reported on the status line and the widget opens on its defaults. A host that reads or edits the restored layout (getState, the indicators, the view) awaits it.

root: HTMLElement

The .oac-widget element.

series: SeriesApi

The primary series; its handle stays stable across chart-type changes.

Methods

  • Open trader alerts and their lifecycle states. False after destruction.

    Returns boolean

  • Show candle and study readings. False when panels are disabled or after destruction.

    Returns boolean

  • Open the go-to panel. False after destruction or on an interval without time buckets.

    Returns boolean

  • Open the Layouts menu. False without a workspaces store (or layouts controller), or after destruction.

    Returns boolean

  • Open the docked news reader. False without a news source, with panels off, or after destruction.

    Returns boolean

  • Open the searchable object inventory. False after destruction.

    Returns boolean

  • Open the settings dialog. False when the dialog tier has not registered one.

    Returns boolean

  • Open the docked watchlist. False without a watchlist source, with panels off, or after destruction.

    Returns boolean

  • The preset range in force, or null: none was set, or the interval has changed since.

    Returns null | string

  • Load (or reload) bars from the feed for the current symbol and interval.

    Returns Promise<void>

  • Select a chart type while retaining series state: a renderer, or a transform the chart applies to the bars the widget loads (Heikin Ashi, Renko, range bars, line break, point and figure, Kagi). A widget whose host feeds series itself keeps point and figure and Kagi as renderers over the elements that host prepares, as before.

    Parameters

    • id: string

    Returns void

  • Show another of the feed's series for the same instrument. A change is a new source: the load in flight is cancelled, the bars are cleared and the variant is loaded, or reported unsupported when the feed does not declare it. Undefined returns to the default. Throws a TypeError for a malformed one.

    Parameters

    Returns void

  • Parameters

    • symbol: string
    • Optionalexchange: string

    Returns void