<!-- Public documentation export; not library implementation source. -->
# ILumenChartingLibraryWidget

[Integration guide](https://docs.lumencharts.com/charting-library/getting-started/lifecycle) · [Reference index](https://docs.lumencharts.com/charting-library/api/)

Runtime facade. Entries identify whether the current source exposes each member. Optional provider-dependent methods still require their configured capability.

The widget returned by `new LumenChartingLibrary.widget(options)`. It owns the chart iframe, its charts and layout, and is disposed with `remove()`.

## loadAutomation {#loadautomation}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
loadAutomation(): Promise<void>;
```

Explicitly load the optional automation asset before creating command adapters.

## loadTrading {#loadtrading}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
loadTrading(): Promise<void>;
```

Install optional trading assets for this widget collection; broker hydration is independent.

## headerReady {#headerready}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
headerReady(): Promise<void>;
```

Returns a promise that resolves once the chart frame has loaded and the header toolbar is ready to accept custom buttons and dropdowns. Rejects when the header is disabled.

## onChartReady {#onchartready}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
onChartReady(callback: EmptyCallback): void;
```

Registers a callback that runs once the chart API is ready, or runs it immediately if the chart is already ready. Errors thrown by the callback are logged and do not stop other ready callbacks.

| Parameter | Type | Required |
| --- | --- | --- |
| `callback` | `EmptyCallback` | Yes |

## onGrayedObjectClicked {#ongrayedobjectclicked}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
onGrayedObjectClicked(callback: (obj: GrayedObject) => void): void;
```

Accepted for compatibility; has no effect.

| Parameter | Type | Required |
| --- | --- | --- |
| `callback` | `(obj: GrayedObject) => void` | Yes |

## onShortcut {#onshortcut}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
onShortcut(
    shortCut: string | number | (string | number)[],
    callback: EmptyCallback,
  ): void;
```

Registers a keyboard shortcut inside the chart frame and calls `callback` with the keyboard event when it is pressed. The shortcut is registered after the chart frame loads.

| Parameter | Type | Required |
| --- | --- | --- |
| `shortCut` | `string &#124; number &#124; (string &#124; number)[]` | Yes |
| `callback` | `EmptyCallback` | Yes |

## subscribe {#subscribe}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
subscribe<EventName extends keyof SubscribeEventsMap>(
    event: EventName,
    callback: SubscribeEventsMap[EventName],
  ): void;
```

Subscribes `callback` to a widget event once the chart API is ready. Keep the same callback reference to remove it later with `unsubscribe`.

| Parameter | Type | Required |
| --- | --- | --- |
| `event` | `EventName` | Yes |
| `callback` | `SubscribeEventsMap[EventName]` | Yes |

## unsubscribe {#unsubscribe}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
unsubscribe<EventName extends keyof SubscribeEventsMap>(
    event: EventName,
    callback: SubscribeEventsMap[EventName],
  ): void;
```

Removes a callback previously added with `subscribe`. Subscriptions are matched by callback reference.

| Parameter | Type | Required |
| --- | --- | --- |
| `event` | `EventName` | Yes |
| `callback` | `SubscribeEventsMap[EventName]` | Yes |

## chart {#chart}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
chart(index?: number): IChartWidgetApi;
```

Returns the API for the visible chart at `index` in the layout, defaulting to the first chart. Throws a `RangeError` when the index is outside the visible charts.

| Parameter | Type | Required |
| --- | --- | --- |
| `index` | `number` | No |

## getLanguage {#getlanguage}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
getLanguage(): LanguageCode;
```

Returns the locale the widget resolved at construction; unsupported locales fall back to `en`.

## setSymbol {#setsymbol}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
setSymbol(
    symbol: string,
    interval: ResolutionString,
    callback: EmptyCallback,
  ): void;
```

Changes the symbol of the active chart, or of all linked charts when symbol lock is on, and sets the interval when one is given. `callback` runs once data for the new interval is ready, or immediately when no interval is passed.

| Parameter | Type | Required |
| --- | --- | --- |
| `symbol` | `string` | Yes |
| `interval` | `ResolutionString` | Yes |
| `callback` | `EmptyCallback` | Yes |

## remove {#remove}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
remove(): void;
```

Removes the chart frame from the page, detaches the window resize listener, and drops any pending `onChartReady` callbacks.

## closePopupsAndDialogs {#closepopupsanddialogs}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
closePopupsAndDialogs(): void;
```

Closes the open chart dialog, or any open menus and popups, once the chart API is ready.

## selectLineTool {#selectlinetool}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
selectLineTool(linetool: "icon", options?: IconOptions): void;
```

Selects the icon drawing tool on the active chart, using `options` to choose the icon.

| Parameter | Type | Required |
| --- | --- | --- |
| `linetool` | `"icon"` | Yes |
| `options` | `IconOptions` | No |

## selectLineTool (overload 2) {#selectlinetool-1}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
selectLineTool(linetool: "emoji", options?: EmojiOptions): void;
```

Selects the emoji drawing tool on the active chart, using `options` to choose the emoji.

| Parameter | Type | Required |
| --- | --- | --- |
| `linetool` | `"emoji"` | Yes |
| `options` | `EmojiOptions` | No |

## selectLineTool (overload 3) {#selectlinetool-2}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
selectLineTool(
    linetool: SupportedLineTools,
    options?: IconOptions | EmojiOptions,
  ): void;
```

Selects a drawing tool on the active chart so the next pointer action draws it, applying any creation options. `cursor` clears the selection, `measure` starts a temporary measurement, and tools that are only selectable are ignored.

| Parameter | Type | Required |
| --- | --- | --- |
| `linetool` | `SupportedLineTools` | Yes |
| `options` | `IconOptions &#124; EmojiOptions` | No |

## selectedLineTool {#selectedlinetool}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
selectedLineTool(): SupportedLineTools;
```

Returns the drawing tool currently selected on the active chart, or `cursor` when none is selected.

## save {#save}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
save(callback: (state: object) => void, options?: SaveChartOptions): void;
```

Serializes the current layout and passes the state object to `callback` synchronously. Throws in an analysis workspace, where each chart is saved automatically.

| Parameter | Type | Required |
| --- | --- | --- |
| `callback` | `(state: object) => void` | Yes |
| `options` | `SaveChartOptions` | No |

## load {#load}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
load(state: object, extendedData?: SavedStateMetaInfo): void;
```

Replaces the current layout with a saved state, discarding charts the state does not use; `extendedData` sets the layout's id and name. Throws when the state cannot be restored or in an analysis workspace.

| Parameter | Type | Required |
| --- | --- | --- |
| `state` | `object` | Yes |
| `extendedData` | `SavedStateMetaInfo` | No |

## getSavedCharts {#getsavedcharts}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
getSavedCharts(callback: (chartRecords: SaveLoadChartRecord[]) => void): void;
```

Fetches the list of saved layouts from the configured chart storage and passes the records to `callback`.

| Parameter | Type | Required |
| --- | --- | --- |
| `callback` | `(chartRecords: SaveLoadChartRecord[]) => void` | Yes |

## loadChartFromServer {#loadchartfromserver}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
loadChartFromServer(chartRecord: SaveLoadChartRecord): void;
```

Loads a saved layout from the configured chart storage and applies it to the widget. Records that are not valid storage records are ignored, and a load replaced by a later load does not apply.

| Parameter | Type | Required |
| --- | --- | --- |
| `chartRecord` | `SaveLoadChartRecord` | Yes |

## saveChartToServer {#savecharttoserver}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
saveChartToServer(
    onComplete?: EmptyCallback,
    onFail?: EmptyCallback,
    options?: SaveChartToServerOptions,
  ): void;
```

Saves the current layout to the configured chart storage, updating the current layout or creating a new one, and calls `onComplete` with the saved id and content. Calls `onFail` when the save fails or the layout has no name; saves run one at a time.

| Parameter | Type | Required |
| --- | --- | --- |
| `onComplete` | `EmptyCallback` | No |
| `onFail` | `EmptyCallback` | No |
| `options` | `SaveChartToServerOptions` | No |

## removeChartFromServer {#removechartfromserver}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
removeChartFromServer(
    chartId: string,
    onCompleteCallback: EmptyCallback,
  ): void;
```

Deletes the saved layout with `chartId` from the configured chart storage and calls `onCompleteCallback` when it finishes.

| Parameter | Type | Required |
| --- | --- | --- |
| `chartId` | `string` | Yes |
| `onCompleteCallback` | `EmptyCallback` | Yes |

## onContextMenu {#oncontextmenu}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
onContextMenu(
    callback: (unixTime: number, price: number) => ContextMenuItem[],
  ): void;
```

Adds a callback whose items are merged into the chart pane's context menu, called with the time and price under the pointer when the menu opens.

| Parameter | Type | Required |
| --- | --- | --- |
| `callback` | `(unixTime: number, price: number) => ContextMenuItem[]` | Yes |

## createButton {#createbutton}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
createButton(options?: CreateHTMLButtonOptions): HTMLElement;
```

Adds a custom HTML button to the chart header and returns its element for you to fill and style. Throws if the header is not ready; wait for `headerReady()` first.

| Parameter | Type | Required |
| --- | --- | --- |
| `options` | `CreateHTMLButtonOptions` | No |

## createButton (overload 2) {#createbutton-1}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
createButton(options?: CreateChartUiStyledButtonOptions): void;
```

Adds a button styled like the built-in header controls, using the given label and click handler, and returns nothing. Throws if the header is not ready; wait for `headerReady()` first.

| Parameter | Type | Required |
| --- | --- | --- |
| `options` | `CreateChartUiStyledButtonOptions` | No |

## createButton (overload 3) {#createbutton-2}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
createButton(options?: CreateButtonOptions): HTMLElement | undefined;
```

Adds a custom button to the chart header and returns its element, or `undefined` for a chart-UI-styled button. Throws if the header is not ready; wait for `headerReady()` first.

| Parameter | Type | Required |
| --- | --- | --- |
| `options` | `CreateButtonOptions` | No |

## createDropdown {#createdropdown}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
createDropdown(params: DropdownParams): Promise<IDropdownApi>;
```

Adds a dropdown to the chart header and resolves with an API to update or remove it once the header is ready. Throws when called without parameters and rejects when the header is disabled.

| Parameter | Type | Required |
| --- | --- | --- |
| `params` | `DropdownParams` | Yes |

## showNoticeDialog {#shownoticedialog}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
showNoticeDialog(params: DialogParams<() => void>): void;
```

Shows a message dialog with `title`, `body` and one OK button, then calls `callback` when it is dismissed. Waits for the chart UI to mount, or calls the callback if the UI is unavailable.

| Parameter | Type | Required |
| --- | --- | --- |
| `params` | `DialogParams<() => void>` | Yes |

## showConfirmDialog {#showconfirmdialog}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
showConfirmDialog(params: DialogParams<(confirmed: boolean) => void>): void;
```

Shows a dialog with `title`, `body`, OK and Cancel, then calls `callback` with `true` for OK and `false` for Cancel or dismissal. Waits for the chart UI to mount, or reports `false` if the UI is unavailable.

| Parameter | Type | Required |
| --- | --- | --- |
| `params` | `DialogParams<(confirmed: boolean) => void>` | Yes |

## showSymbolSearchDialog {#showsymbolsearchdialog}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
showSymbolSearchDialog(): void;
```

Open symbol search for the active chart.

## showLoadChartDialog {#showloadchartdialog}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
showLoadChartDialog(): void;
```

Opens the dialog for loading a saved layout.

## showSaveAsChartDialog {#showsaveaschartdialog}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
showSaveAsChartDialog(): void;
```

Opens the dialog for saving the current layout under a new name.

## symbolInterval {#symbolinterval}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
symbolInterval(): SymbolIntervalResult;
```

Returns the active chart's symbol and interval, along with its display symbol when one is resolved.

## mainSeriesPriceFormatter {#mainseriespriceformatter}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
mainSeriesPriceFormatter(): INumberFormatter;
```

Returns the price formatter for the active chart's main series, which uses the series precision and symbol information.

## getIntervals {#getintervals}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
getIntervals(): string[];
```

Returns the intervals the active chart offers: the datafeed's supported resolutions, or the current interval when the datafeed declares none.

## getStudiesList {#getstudieslist}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
getStudiesList(): string[];
```

Returns the names of all indicators in the study library, excluding hidden ones.

## getStudyInputs {#getstudyinputs}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
getStudyInputs(studyName: string): StudyInputInformation[];
```

Returns the inputs of the indicator whose name matches `studyName`, ignoring case. Throws when no indicator matches.

| Parameter | Type | Required |
| --- | --- | --- |
| `studyName` | `string` | Yes |

## getStudyStyles {#getstudystyles}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
getStudyStyles(studyName: string): StudyStyleInfo;
```

Returns the plot and style metadata of the indicator whose name matches `studyName`, ignoring case. Throws when no indicator matches.

| Parameter | Type | Required |
| --- | --- | --- |
| `studyName` | `string` | Yes |

## addCustomCSSFile {#addcustomcssfile}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
addCustomCSSFile(url: string): void;
```

Adds a stylesheet link to the chart frame. Call it after the chart frame has loaded.

| Parameter | Type | Required |
| --- | --- | --- |
| `url` | `string` | Yes |

## applyOverrides {#applyoverrides}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
applyOverrides<TOverrides extends Partial<ChartPropertiesOverrides>>(
    overrides: TOverrides,
  ): void;
```

Applies chart property overrides to every chart in the layout once the chart frame loads and keeps them in the widget options. Throws when the overrides select the volume footprint style without the `chart_style_volume_footprint` feature.

| Parameter | Type | Required |
| --- | --- | --- |
| `overrides` | `TOverrides` | Yes |

**Failure conditions:** `Volume footprint requires the chart_style_volume_footprint feature`.

## applyStudiesOverrides {#applystudiesoverrides}

**Limited.** The overrides are stored but not yet applied to indicators.

```ts
applyStudiesOverrides(overrides: object): void;
```

Records indicator default overrides on every chart. The current runtime stores them but does not apply them to existing or new indicators yet.

| Parameter | Type | Required |
| --- | --- | --- |
| `overrides` | `object` | Yes |

## watchList {#watchlist}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
watchList(): Promise<IWatchListApi>;
```

Resolves with the watchlist API, or with `null` when `widgetbar.watchlist` is not enabled.

## news {#news}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
news(): Promise<INewsApi>;
```

Returns a promise for the news panel API, which refreshes headlines for the active symbol from the configured news provider or RSS feeds. Resolves to `null` unless `widgetbar.news` is enabled in the widget options.

## widgetbar {#widgetbar}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
widgetbar(): Promise<IWidgetbarApi>;
```

Returns a promise for the widget bar API, which shows and hides right-toolbar pages such as the data window. When the `right_toolbar` feature is disabled, requests to open a page are ignored.

## activeChart {#activechart}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
activeChart(): IChartWidgetApi;
```

Returns the API of the chart that is currently active in the layout. Throws if the chart frame has not loaded yet.

## pineWorkspace {#pineworkspace}

**Capability-dependent.** Requires the matching optional feature/provider and valid chart binding.

```ts
pineWorkspace(): Promise<PineEditorWorkspaceApi | null>;
```

Returns the host-facing Pine editor facade when Pine is enabled for this widget.

## pineRuntime {#pineruntime}

**Capability-dependent.** Requires the matching optional feature/provider and valid chart binding.

```ts
pineRuntime(): Promise<PineChartRuntimeApi | null>;
```

Returns a promise for the Pine chart runtime API once the chart frame has loaded. Resolves to `null` when `pine_script.enabled` is not set.

## activeChartIndex {#activechartindex}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
activeChartIndex(): number;
```

Returns the zero-based index of the active chart in the current layout.

## setActiveChart {#setactivechart}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
setActiveChart(index: number): void;
```

Makes the chart at the given zero-based index active. Indices outside the visible charts are ignored, and a maximized layout stays maximized on the newly active chart.

| Parameter | Type | Required |
| --- | --- | --- |
| `index` | `number` | Yes |

## chartsCount {#chartscount}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
chartsCount(): number;
```

Returns the number of charts visible in the current layout.

## unloadUnusedCharts {#unloadunusedcharts}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
unloadUnusedCharts(): void;
```

Destroys charts kept in memory beyond the current layout's visible count, such as those left over after switching to a layout with fewer charts.

## layout {#layout}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
layout(): LayoutType;
```

Returns the current multi-chart layout type, falling back to the single-chart layout when the stored value is not a public layout.

## setLayout {#setlayout}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
setLayout(layout: LayoutType): void;
```

Switches the widget to the given multi-chart layout, adding or hiding charts to match and emitting `layout_about_to_be_changed` and `layout_changed`. Unknown layout types are ignored; it throws when the layout needs more charts than allowed or when an analysis workspace manages the layout.

| Parameter | Type | Required |
| --- | --- | --- |
| `layout` | `LayoutType` | Yes |

## layoutName {#layoutname}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
layoutName(): string;
```

Returns the current layout type; this is the same value as `layout()`.

## resetCache {#resetcache}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
resetCache(): void;
```

Reset cached bar data for all chart sessions owned by this widget.

## resetLayoutSizes {#resetlayoutsizes}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
resetLayoutSizes(disableUndo?: boolean): void;
```

Restores the default split sizes of the charts in a multi-chart layout. The `disableUndo` argument is accepted but ignored.

| Parameter | Type | Required |
| --- | --- | --- |
| `disableUndo` | `boolean` | No |

## changeTheme {#changetheme}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
changeTheme(
    themeName: ThemeName,
    options?: ChangeThemeOptions,
  ): Promise<void>;
```

Switches every chart to the `dark` or `light` theme (any other name selects light), reapplies the user's saved chart defaults for that theme, and emits `theme_changed`. The `options` argument is ignored and the promise resolves once the theme is applied.

| Parameter | Type | Required |
| --- | --- | --- |
| `themeName` | `ThemeName` | Yes |
| `options` | `ChangeThemeOptions` | No |

## getTheme {#gettheme}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
getTheme(): ThemeName;
```

Returns the current theme name, either `light` or `dark`.

## takeScreenshot {#takescreenshot}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
takeScreenshot(): void;
```

Captures an image of the visible charts once the chart API is ready and emits `onScreenshotReady` with the resulting image data URL.

## takeClientScreenshot {#takeclientscreenshot}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
takeClientScreenshot(
    options?: Partial<ClientSnapshotOptions> & { onlyActiveChart?: boolean; chartIndex?: number },
  ): Promise<string>;
```

Captures the visible charts in the browser and resolves with an image data URL (PNG or SVG), also emitting `onScreenshotReady`. Options can limit the capture to the active chart or one chart index; it rejects when the requested chart is unavailable.

| Parameter | Type | Required |
| --- | --- | --- |
| `options` | `Partial<ClientSnapshotOptions> & { onlyActiveChart?: boolean; chartIndex?: number }` | No |

**Failure conditions:** `Chart capture is unavailable`.

## lockAllDrawingTools {#lockalldrawingtools}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
lockAllDrawingTools(): IWatchedValue<boolean>;
```

Returns a watched value of whether the active chart's drawings are locked against moving and editing. `setValue(true)` locks them; it follows the active chart.

## hideAllDrawingTools {#hidealldrawingtools}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
hideAllDrawingTools(): IWatchedValue<boolean>;
```

Returns a watched value of whether the active chart's drawings are hidden. `setValue(true)` hides them and drops them from the selection; it follows the active chart.

## magnetEnabled {#magnetenabled}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
magnetEnabled(): IWatchedValue<boolean>;
```

Returns a watched value that turns the drawing magnet on or off. It starts from the saved preference or the `magnet` widget option, defaults to `false`, and saves each change to settings storage.

## magnetMode {#magnetmode}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
magnetMode(): IWatchedValue<number>;
```

Returns a watched value holding the drawing magnet mode, `0` or `1`. It starts from the saved preference or the `magnetMode` widget option and saves each change to settings storage.

## symbolSync {#symbolsync}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
symbolSync(): IWatchedValue<boolean>;
```

Returns a watched value that controls whether charts in a multi-chart layout share the same symbol.

## intervalSync {#intervalsync}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
intervalSync(): IWatchedValue<boolean>;
```

Returns a watched value that controls whether charts in a multi-chart layout share the same interval.

## crosshairSync {#crosshairsync}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
crosshairSync(): IWatchedValue<boolean>;
```

Returns a watched value that controls whether the crosshair position is mirrored across charts in a multi-chart layout.

## timeSync {#timesync}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
timeSync(): IWatchedValue<boolean>;
```

Returns a watched value that controls whether charts in a multi-chart layout follow the same time position.

## dateRangeSync {#daterangesync}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
dateRangeSync(): IWatchedValue<boolean>;
```

Returns a watched value that controls whether charts in a multi-chart layout share the same visible date range.

## startFullscreen {#startfullscreen}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
startFullscreen(): void;
```

Requests browser fullscreen for the active chart's root element and emits `fullscreen_changed` with `true`.

## exitFullscreen {#exitfullscreen}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
exitFullscreen(): void;
```

Leaves browser fullscreen and emits `fullscreen_changed` with `false`.

## undoRedoState {#undoredostate}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
undoRedoState(): UndoRedoState;
```

Returns whether the active chart currently has an action to undo and an action to redo.

## navigationButtonsVisibility {#navigationbuttonsvisibility}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
navigationButtonsVisibility(): IWatchedValue<VisibilityType>;
```

Returns a watched value of the active chart's navigation button visibility (default `visibleOnMouseOver`). Setting it changes the active chart.

## paneButtonsVisibility {#panebuttonsvisibility}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
paneButtonsVisibility(): IWatchedValue<VisibilityType>;
```

Returns a watched value of the active chart's pane button visibility (default `visibleOnMouseOver`). Setting it changes the active chart.

## dateFormat {#dateformat}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
dateFormat(): IWatchedValue<DateFormat>;
```

Returns a watched value of the active chart's date format (default `dd MMM 'yy`). Setting it changes the active chart.

## timeHoursFormat {#timehoursformat}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
timeHoursFormat(): IWatchedValue<TimeHoursFormat>;
```

Returns a watched value of the active chart's time format (default `24-hours`). Setting it changes the active chart.

## currencyAndUnitVisibility {#currencyandunitvisibility}

**Limited.** The chart shows no currency or unit label, so the value stays `alwaysOff`.

```ts
currencyAndUnitVisibility(): IWatchedValue<VisibilityType>;
```

Returns a watched value fixed at `alwaysOff`: the chart shows no currency or unit label, so setting it has no effect.

## setDebugMode {#setdebugmode}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
setDebugMode(enabled: boolean): void;
```

Stores the debug flag in the chart frame's options. The runtime does not read it after startup, so it has no visible effect.

| Parameter | Type | Required |
| --- | --- | --- |
| `enabled` | `boolean` | Yes |

## drawOnAllChartsEnabled {#drawonallchartsenabled}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
drawOnAllChartsEnabled(): IWatchedValue<boolean>;
```

Returns a watched value, `false` by default, that controls whether new drawings are synced to every chart in a multi-chart layout.

## clearUndoHistory {#clearundohistory}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
clearUndoHistory(): void;
```

Clears the undo and redo history of the active chart.

## setSaveStatus {#setsavestatus}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
setSaveStatus(status: "saving" | "saved" | "failed" | "load-failed" | null): void;
```

Shows how the host's autosave is going in the header's save/load slot.
Requires the `header_save_status` featureset; `null` hides it. Clicking a
failed status raises `save_status_retry_requested`.

| Parameter | Type | Required |
| --- | --- | --- |
| `status` | `"saving" &#124; "saved" &#124; "failed" &#124; "load-failed" &#124; null` | Yes |

## supportedChartTypes {#supportedcharttypes}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
supportedChartTypes(): IWatchedValueReadonly<ChartStyle[]>;
```

Returns a read-only watched value listing the chart styles the runtime supports. It updates when the high-low style feature is turned on or off.

## watermark {#watermark}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
watermark(): IWatermarkApi;
```

Returns the watermark API for the active chart, which controls the watermark's color, visibility and text content.

## customSymbolStatus {#customsymbolstatus}

**Limited.** Statuses are stored but not yet drawn on the chart.

```ts
customSymbolStatus(): ICustomSymbolStatusApi;
```

Returns the store for custom symbol statuses: `symbol(id)` returns a chainable adapter for visibility, icon, colour, tooltip and drop-down content, and `hideAll()` hides every status. The chart keeps these values but does not draw them yet.

## setCSSCustomProperty {#setcsscustomproperty}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
setCSSCustomProperty(customPropertyName: string, value: string): void;
```

Sets a CSS custom property on the chart frame's body element. Throws when the name does not start with `--`.

| Parameter | Type | Required |
| --- | --- | --- |
| `customPropertyName` | `string` | Yes |
| `value` | `string` | Yes |

**Failure conditions:** `customPropertyName should begin with a double hyphen`.

## getCSSCustomPropertyValue {#getcsscustompropertyvalue}

**Runtime-backed.** Use after chart readiness unless this is a readiness or disposal method.

```ts
getCSSCustomPropertyValue(customPropertyName: string): string;
```

Returns the value of a CSS custom property from the chart frame's body, preferring an inline value over the computed style. Throws when the name does not start with `--`.

| Parameter | Type | Required |
| --- | --- | --- |
| `customPropertyName` | `string` | Yes |

**Failure conditions:** `customPropertyName should begin with a double hyphen`.

## Related types

- [EmptyCallback](https://docs.lumencharts.com/charting-library/api/EmptyCallback)
- [GrayedObject](https://docs.lumencharts.com/charting-library/api/GrayedObject)
- [SubscribeEventsMap](https://docs.lumencharts.com/charting-library/api/SubscribeEventsMap)
- [IChartWidgetApi](https://docs.lumencharts.com/charting-library/api/IChartWidgetApi)
- [LanguageCode](https://docs.lumencharts.com/charting-library/api/LanguageCode)
- [ResolutionString](https://docs.lumencharts.com/charting-library/api/ResolutionString)
- [IconOptions](https://docs.lumencharts.com/charting-library/api/IconOptions)
- [EmojiOptions](https://docs.lumencharts.com/charting-library/api/EmojiOptions)
- [SupportedLineTools](https://docs.lumencharts.com/charting-library/api/SupportedLineTools)
- [SaveChartOptions](https://docs.lumencharts.com/charting-library/api/SaveChartOptions)
- [SavedStateMetaInfo](https://docs.lumencharts.com/charting-library/api/SavedStateMetaInfo)
- [SaveLoadChartRecord](https://docs.lumencharts.com/charting-library/api/SaveLoadChartRecord)
- [SaveChartToServerOptions](https://docs.lumencharts.com/charting-library/api/SaveChartToServerOptions)
- [ContextMenuItem](https://docs.lumencharts.com/charting-library/api/ContextMenuItem)
- [CreateHTMLButtonOptions](https://docs.lumencharts.com/charting-library/api/CreateHTMLButtonOptions)
- [CreateChartUiStyledButtonOptions](https://docs.lumencharts.com/charting-library/api/CreateChartUiStyledButtonOptions)
- [CreateButtonOptions](https://docs.lumencharts.com/charting-library/api/CreateButtonOptions)
- [DropdownParams](https://docs.lumencharts.com/charting-library/api/DropdownParams)
- [IDropdownApi](https://docs.lumencharts.com/charting-library/api/IDropdownApi)
- [DialogParams](https://docs.lumencharts.com/charting-library/api/DialogParams)
- [SymbolIntervalResult](https://docs.lumencharts.com/charting-library/api/SymbolIntervalResult)
- [INumberFormatter](https://docs.lumencharts.com/charting-library/api/INumberFormatter)
- [StudyInputInformation](https://docs.lumencharts.com/charting-library/api/StudyInputInformation)
- [StudyStyleInfo](https://docs.lumencharts.com/charting-library/api/StudyStyleInfo)
- [ChartPropertiesOverrides](https://docs.lumencharts.com/charting-library/api/ChartPropertiesOverrides)
- [IWatchListApi](https://docs.lumencharts.com/charting-library/api/IWatchListApi)
- [INewsApi](https://docs.lumencharts.com/charting-library/api/INewsApi)
- [IWidgetbarApi](https://docs.lumencharts.com/charting-library/api/IWidgetbarApi)
- [PineEditorWorkspaceApi](https://docs.lumencharts.com/charting-library/api/PineEditorWorkspaceApi)
- [PineChartRuntimeApi](https://docs.lumencharts.com/charting-library/api/PineChartRuntimeApi)
- [LayoutType](https://docs.lumencharts.com/charting-library/api/LayoutType)
- [ThemeName](https://docs.lumencharts.com/charting-library/api/ThemeName)
- [ChangeThemeOptions](https://docs.lumencharts.com/charting-library/api/ChangeThemeOptions)
- [ClientSnapshotOptions](https://docs.lumencharts.com/charting-library/api/ClientSnapshotOptions)
- [IWatchedValue](https://docs.lumencharts.com/charting-library/api/IWatchedValue)
- [UndoRedoState](https://docs.lumencharts.com/charting-library/api/UndoRedoState)
- [VisibilityType](https://docs.lumencharts.com/charting-library/api/VisibilityType)
- [DateFormat](https://docs.lumencharts.com/charting-library/api/DateFormat)
- [TimeHoursFormat](https://docs.lumencharts.com/charting-library/api/TimeHoursFormat)
- [IWatchedValueReadonly](https://docs.lumencharts.com/charting-library/api/IWatchedValueReadonly)
- [ChartStyle](https://docs.lumencharts.com/charting-library/api/ChartStyle)
- [IWatermarkApi](https://docs.lumencharts.com/charting-library/api/IWatermarkApi)
- [ICustomSymbolStatusApi](https://docs.lumencharts.com/charting-library/api/ICustomSymbolStatusApi)

---
Documentation page: https://docs.lumencharts.com/charting-library/api/ILumenChartingLibraryWidget
