Skip to main content

Interface: SubscribeEventsMap

Charting Library.SubscribeEventsMap

Properties

activeChartChanged

activeChartChanged: (chartIndex: number) => void

Active chart has changed. Note: this event is only applicable to Trading Platform.

Parameters
NameTypeDescription
chartIndexnumberindex of the active chart

add_compare

add_compare: EmptyCallback

A compare instrument has been added


chart_load_requested

chart_load_requested: (savedData: object) => void

New chart is about to be loaded

Parameters
NameTypeDescription
savedDataobjectchart data about to be loaded

chart_loaded

chart_loaded: EmptyCallback

Chart has finished loading


chart_theme_changed

chart_theme_changed: (themeName: string, isStandardTheme: boolean, onlyActiveChart: boolean) => void

Fired when the chart theme is updated. This event can be triggered in several ways:

Parameters
NameTypeDescription
themeNamestringThe name of the chart theme or template that was applied.
isStandardThemebooleantrue if the default built-in theme was restored; false, if a custom chart template was applied.
onlyActiveChartbooleanfalse, when applied to all charts

compare_add

compare_add: EmptyCallback

A compare dialog has been shown


dragend

dragend: EmptyCallback

Drag end


dragstart

dragstart: (params: DragStartParams) => void

Drag start

Parameters
NameType
paramsDragStartParams

drawing

drawing: (params: StudyOrDrawingAddedToChartEventParams) => void

A drawing has been added to a chart.

Parameters
NameTypeDescription
paramsStudyOrDrawingAddedToChartEventParamsThe arguments contain an object with the value field that corresponds with the name of the drawing.

drawing_event

drawing_event: (sourceId: EntityId, drawingEventType: DrawingEventType) => void

Drawing was hidden, shown, moved, removed, clicked, or created

Parameters
NameTypeDescription
sourceIdEntityIddrawing ID
drawingEventTypeDrawingEventTypedrawing event type

edit_object_dialog

edit_object_dialog: (params: EditObjectDialogEventParams) => void

Chart / Study Properties dialog is shown

Parameters
NameTypeDescription
paramsEditObjectDialogEventParamsmeta information about the dialog type and the title of the chart or study

indicators_dialog

indicators_dialog: EmptyCallback

Indicators dialog is shown


layout_about_to_be_changed

layout_about_to_be_changed: (newLayoutType: LayoutType) => void

Amount or placement of the charts is about to be changed. Note: this event is only applicable to Trading Platform.

Parameters
NameTypeDescription
newLayoutTypeLayoutTypewhether the layout is single or multi-chart

layout_changed

layout_changed: EmptyCallback

Amount or placement of the charts is changed. Note: this event is only applicable to Trading Platform.


load_study_template

load_study_template: EmptyCallback

A study template has been loaded


mouse_down

mouse_down: (params: MouseEventParams) => void

Mouse button has been pressed

Parameters
NameType
paramsMouseEventParams

mouse_up

mouse_up: (params: MouseEventParams) => void

Mouse button has been released

Parameters
NameType
paramsMouseEventParams

onAutoSaveNeeded

onAutoSaveNeeded: EmptyCallback

User has changed the chart. Chart change means any user action that can be undone. The callback function will not be called more than once every 5 seconds. See also auto_save_delay within the Widget constructor options (ChartingLibraryWidgetOptions.auto_save_delay).


onMarkClick

onMarkClick: (markId: string | number) => void

User has clicked on a 'mark on a bar'.

Parameters
NameTypeDescription
markIdstring | numberID of the clicked mark

onPlusClick

onPlusClick: (params: PlusClickParams) => void

User clicked the Plus button on the price scale.

Parameters
NameTypeDescription
paramsPlusClickParamscoordinates, price, and symbol information

onScreenshotReady

onScreenshotReady: (url: string) => void

A screenshot URL has been returned by the server

Parameters
NameTypeDescription
urlstringurl of the screenshot

onSelectedLineToolChanged

onSelectedLineToolChanged: EmptyCallback

Selected drawing tool has changed


onTick

onTick: (tick: Bar) => void

Last bar has been updated

Parameters
NameTypeDescription
tickBardata for last bar

onTimescaleMarkClick

onTimescaleMarkClick: (markId: string | number) => void

User clicked a 'timescale mark'.

Parameters
NameTypeDescription
markIdstring | numberID of the clicked timescale mark

panes_height_changed

panes_height_changed: EmptyCallback

Panes' size has changed.


panes_order_changed

panes_order_changed: EmptyCallback

Panes' order has changed.


redo

Redo action occurred


reset_scales

reset_scales: EmptyCallback

Reset scales button has been clicked


series_event

series_event: (seriesEventType: "price_scale_changed") => void

An event related to the series has occurred.

Parameters
NameTypeDescription
seriesEventType"price_scale_changed"series event type

series_properties_changed

series_properties_changed: (id: EntityId) => void

Main series properties have changed.

Parameters
NameTypeDescription
idEntityIdentity ID

study

study: (params: StudyOrDrawingAddedToChartEventParams) => void

An indicator has been added to a chart.

Parameters
NameTypeDescription
paramsStudyOrDrawingAddedToChartEventParamsThe arguments contain an object with the value field that corresponds with the name of the indicator.

study_dialog_save_defaults

study_dialog_save_defaults: (id: EntityId) => void

The Save as default option is selected in the drop-down menu of the indicator settings.

Parameters
NameTypeDescription
idEntityIdentity ID

study_event

study_event: (entityId: EntityId, studyEventType: StudyEventType) => void

An event related to the study has occurred.

Parameters
NameTypeDescription
entityIdEntityIdstudy ID
studyEventTypeStudyEventTypestudy event type

study_properties_changed

study_properties_changed: (id: EntityId) => void

Study properties have changed.

Parameters
NameTypeDescription
idEntityIdentity ID

timeframe_interval

timeframe_interval: (range: RangeOptions) => void

Time interval has been changed. Can come from either the bottom toolbar or the setTimeFrame API.

Parameters
NameTypeDescription
rangeRangeOptionsObject that represents a selected time frame.

toggle_header

toggle_header: (isHidden: boolean) => void

Chart header is shown/hidden

Parameters
NameTypeDescription
isHiddenbooleanis the chart header currently hidden

toggle_sidebar

toggle_sidebar: (isHidden: boolean) => void

Drawing toolbar is shown/hidden

Parameters
NameTypeDescription
isHiddenbooleanis the drawing toolbar currently hidden

undo

Undo action occurred


undo_redo_state_changed

undo_redo_state_changed: (state: UndoRedoState) => void

The Undo / Redo state has been changed.

Parameters
NameTypeDescription
stateUndoRedoStatestate of the Undo/Redo stack

widgetbar_visibility_changed

widgetbar_visibility_changed: (isVisible: boolean) => void

Chart's widget bar is shown/hidden.

Parameters
NameTypeDescription
isVisiblebooleanif the widget bar is currently hidden