Interface: SubscribeEventsMap
Charting Library.SubscribeEventsMap
Properties
activeChartChanged
• activeChartChanged: (chartIndex: number) => void
Active chart has changed. Note: this event is only applicable to Trading Platform.
Type declaration
▸ (chartIndex): void
Parameters
| Name | Type | Description |
|---|---|---|
chartIndex | number | index of the active chart |
Returns
void
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
Type declaration
▸ (savedData): void
Parameters
| Name | Type | Description |
|---|---|---|
savedData | object | chart data about to be loaded |
Returns
void
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:
- When a user applies a saved chart template.
- When the chart theme is reset to the default settings. (
isStandardThemeparameter will be true) - When the IChartingLibraryWidget.changeTheme method is called.
- When the IChartWidgetApi.loadChartTemplate method is called.
Type declaration
▸ (themeName, isStandardTheme, onlyActiveChart): void
Parameters
| Name | Type | Description |
|---|---|---|
themeName | string | The name of the chart theme or template that was applied. |
isStandardTheme | boolean | true if the default built-in theme was restored; false, if a custom chart template was applied. |
onlyActiveChart | boolean | false, when applied to all charts |
Returns
void
compare_add
• compare_add: EmptyCallback
A compare dialog has been shown
dragEnd
• dragEnd: EmptyCallback
Drag end
dragStart
• dragStart: (params: DragStartParams) => void
Drag start
Type declaration
▸ (params): void
Parameters
| Name | Type |
|---|---|
params | DragStartParams |
Returns
void
drawing
• drawing: (params: StudyOrDrawingAddedToChartEventParams) => void
A drawing has been added to a chart.
Type declaration
▸ (params): void
Parameters
| Name | Type | Description |
|---|---|---|
params | StudyOrDrawingAddedToChartEventParams | The arguments contain an object with the value field that corresponds with the name of the drawing. |
Returns
void
drawing_event
• drawing_event: (sourceId: EntityId, drawingEventType: DrawingEventType) => void
Drawing was hidden, shown, moved, removed, clicked, or created
Type declaration
▸ (sourceId, drawingEventType): void
Parameters
| Name | Type | Description |
|---|---|---|
sourceId | EntityId | drawing ID |
drawingEventType | DrawingEventType | drawing event type |
Returns
void
edit_object_dialog
• edit_object_dialog: (params: EditObjectDialogEventParams) => void
Chart / Study Properties dialog is shown
Type declaration
▸ (params): void
Parameters
| Name | Type | Description |
|---|---|---|
params | EditObjectDialogEventParams | meta information about the dialog type and the title of the chart or study |
Returns
void
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.
Type declaration
▸ (newLayoutType): void
Parameters
| Name | Type | Description |
|---|---|---|
newLayoutType | LayoutType | whether the layout is single or multi-chart |
Returns
void
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
Type declaration
▸ (params): void
Parameters
| Name | Type |
|---|---|
params | MouseEventParams |
Returns
void
mouse_up
• mouse_up: (params: MouseEventParams) => void
Mouse button has been released
Type declaration
▸ (params): void
Parameters
| Name | Type |
|---|---|
params | MouseEventParams |
Returns
void
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'.
Type declaration
▸ (markId): void
Parameters
| Name | Type | Description |
|---|---|---|
markId | string | number | ID of the clicked mark |
Returns
void
onPlusClick
• onPlusClick: (params: PlusClickParams) => void
User clicked the Plus button on the price scale.
Type declaration
▸ (params): void
Parameters
| Name | Type | Description |
|---|---|---|
params | PlusClickParams | coordinates, price, and symbol information |
Returns
void
onScreenshotReady
• onScreenshotReady: (url: string) => void
A screenshot URL has been returned by the server
Type declaration
▸ (url): void
Parameters
| Name | Type | Description |
|---|---|---|
url | string | url of the screenshot |
Returns
void
onSelectedLineToolChanged
• onSelectedLineToolChanged: EmptyCallback
Selected drawing tool has changed
onTick
• onTick: (tick: Bar) => void
Last bar has been updated
Type declaration
▸ (tick): void
Parameters
| Name | Type | Description |
|---|---|---|
tick | Bar | data for last bar |
Returns
void
onTimescaleMarkClick
• onTimescaleMarkClick: (markId: string | number) => void
User clicked a 'timescale mark'.
Type declaration
▸ (markId): void
Parameters
| Name | Type | Description |
|---|---|---|
markId | string | number | ID of the clicked timescale mark |
Returns
void
panes_height_changed
• panes_height_changed: EmptyCallback
Panes' size has changed.
panes_order_changed
• panes_order_changed: EmptyCallback
Panes' order has changed.
redo
• redo: EmptyCallback
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.
Type declaration
▸ (seriesEventType): void
Parameters
| Name | Type | Description |
|---|---|---|
seriesEventType | "price_scale_changed" | series event type |
Returns
void
series_properties_changed
• series_properties_changed: (id: EntityId) => void
Main series properties have changed.
Type declaration
▸ (id): void
Parameters
| Name | Type | Description |
|---|---|---|
id | EntityId | entity ID |
Returns
void
study
• study: (params: StudyOrDrawingAddedToChartEventParams) => void
An indicator has been added to a chart.
Type declaration
▸ (params): void
Parameters
| Name | Type | Description |
|---|---|---|
params | StudyOrDrawingAddedToChartEventParams | The arguments contain an object with the value field that corresponds with the name of the indicator. |
Returns
void
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.
Type declaration
▸ (id): void
Parameters
| Name | Type | Description |
|---|---|---|
id | EntityId | entity ID |
Returns
void
study_event
• study_event: (entityId: EntityId, studyEventType: StudyEventType) => void
An event related to the study has occurred.
Type declaration
▸ (entityId, studyEventType): void
Parameters
| Name | Type | Description |
|---|---|---|
entityId | EntityId | study ID |
studyEventType | StudyEventType | study event type |
Returns
void
study_properties_changed
• study_properties_changed: (id: EntityId) => void
Study properties have changed.
Type declaration
▸ (id): void
Parameters
| Name | Type | Description |
|---|---|---|
id | EntityId | entity ID |
Returns
void
timeframe_interval
• timeframe_interval: (range: RangeOptions) => void
Time interval has been changed. Can come from either the bottom toolbar or the setTimeFrame API.
Type declaration
▸ (range): void
Parameters
| Name | Type | Description |
|---|---|---|
range | RangeOptions | Object that represents a selected time frame. |
Returns
void
toggle_header
• toggle_header: (isHidden: boolean) => void
Chart header is shown/hidden
Type declaration
▸ (isHidden): void
Parameters
| Name | Type | Description |
|---|---|---|
isHidden | boolean | is the chart header currently hidden |
Returns
void
toggle_sidebar
• toggle_sidebar: (isHidden: boolean) => void
Drawing toolbar is shown/hidden
Type declaration
▸ (isHidden): void
Parameters
| Name | Type | Description |
|---|---|---|
isHidden | boolean | is the drawing toolbar currently hidden |
Returns
void
undo
• undo: EmptyCallback
Undo action occurred
undo_redo_state_changed
• undo_redo_state_changed: (state: UndoRedoState) => void
The Undo / Redo state has been changed.
Type declaration
▸ (state): void
Parameters
| Name | Type | Description |
|---|---|---|
state | UndoRedoState | state of the Undo/Redo stack |
Returns
void
widgetbar_visibility_changed
• widgetbar_visibility_changed: (isVisible: boolean) => void
Chart's widget bar is shown/hidden.
Type declaration
▸ (isVisible): void
Parameters
| Name | Type | Description |
|---|---|---|
isVisible | boolean | if the widget bar is currently hidden |
Returns
void