Events
The chart exposes a wide set of runtime events on the unified API.
Chart Lifecycle
| Event | What it tells you |
|---|---|
onChartReady | The chart has finished initializing and is ready to use. |
onDataLoaded | Historical chart data has been loaded. |
onDataUpdate | Live data has updated the chart. |
onSymbolChange | The active symbol has changed. |
onPeriodChange | The active timeframe or resolution has changed. |
onChartTypeChange | The chart style has changed. |
onVisibleRangeChange | The visible time range has changed. |
onFullscreenChange | Fullscreen mode has been turned on or off. |
onHistoryChange | The chart history or saved state has changed. |
Features and Layout
| Event | What it tells you |
|---|---|
onFeatureChange | The enabled or disabled feature set has changed. |
onFeatureEnabled | A feature has been enabled. |
onFeatureDisabled | A feature has been disabled. |
onThemeChange | The active theme has changed. |
onLayoutChange | The active layout has changed. |
onActivePanelChange | The active panel has changed. |
onSyncChange | Sync settings have changed. |
onTemplateChange | The applied template has changed. |
onStatusLineChanged | Status line settings have changed. |
onGridStyleChange | Grid styling has changed. |
onPriceScaleLabelsChange | Price scale label settings have changed. |
onTimeScaleFormatChange | Time scale formatting has changed. |
onCrosshairStyleChange | Crosshair styling has changed. |
onCanvasBackgroundChange | The canvas background has changed. |
onEventsSettingsChange | General events-related settings have changed. |
Market and Session
| Event | What it tells you |
|---|---|
onTimezoneChange | The chart timezone has changed. |
onSessionChange | The trading session string has changed. |
onSessionToggle | Session filtering has been turned on or off. |
Indicators and Alerts
| Event | What it tells you |
|---|---|
onIndicatorAdded | A new indicator has been added. |
onIndicatorRemoved | An indicator has been removed. |
onAlertsChange | Alerts have been added, updated, or removed. |
onAlertTriggered | An alert has been triggered. |
onNotificationAdded | A notification has been added. |
onNotificationRemoved | A notification has been removed. |
onAllNotificationsRemoved | All notifications have been cleared. |
Drawings and Tools
| Event | What it tells you |
|---|---|
onShapeCreated | A drawing shape has been created. |
onShapeRemoved | A drawing shape has been removed. |
onShapeUpdated | A drawing shape has been updated. |
onShapeSelected | A drawing shape has been selected. |
onDrawingModeEnter | Drawing mode has started. |
onDrawingModeExit | Drawing mode has ended. |
onDrawingToolChange | The active drawing tool has changed. |
onDrawingToolActivated | A drawing tool has been activated. |
onDrawingToolDeactivated | The active drawing tool has been deactivated. |
onDrawingsCleared | All drawings have been cleared. |
onDrawingStyleChange | A drawing style has changed. |
onDrawingSnapConfigChange | Snap settings for drawings have changed. |
onDrawingSelected | A drawing has been selected. |
onDrawingUnselected | A drawing has been unselected. |
onDrawingHovered | A drawing has been hovered. |
onDrawingAdded | A drawing has been added. |
onDrawingRemoved | A drawing has been removed. |
onDrawingsLockChange | Drawing lock state has changed. |
onInteractionModeChanged | The current interaction mode has changed. |
onToolModeEnter | A tool mode such as drawing or measure has started. |
onToolModeExit | The active tool mode has ended. |
onMeasurementActivated | Measurement mode has been activated. |
onMeasurementDeactivated | Measurement mode has been deactivated. |
onMeasurementStarted | A measurement interaction has started. |
onMeasurementUpdated | A measurement interaction has updated. |
onMeasurementCompleted | A measurement interaction has completed. |
onMeasurementCancelled | A measurement interaction has been cancelled. |
Replay
| Event | What it tells you |
|---|---|
onSelectStartIndexModeChange | Replay start-index selection mode has changed. |
onReplayPanelShow | The replay panel has been shown. |
onReplayPanelHide | The replay panel has been hidden. |
onReplayStart | Replay has started. |
onReplayStop | Replay has stopped. |
onReplayStepForward | Replay moved forward by one step. |
onReplayStepBackward | Replay moved backward by one step. |
onReplayPlay | Replay playback has started. |
onReplayPause | Replay playback has paused. |
onReplaySpeedChange | Replay speed has changed. |
onReplayUpdateCurrentIndex | The replay position has changed. |
View and Cursor
| Event | What it tells you |
|---|---|
onCrosshairVisibilityChange | Crosshair visibility has changed. |
onCrosshairModeChange | Crosshair mode has changed. |
onTooltipVisibilityChange | Tooltip visibility has changed. |
onCursorModeChange | Cursor mode has changed. |
onPriceScaleViewChange | Price scale position has changed. |
Trading and Data
| Event | What it tells you |
|---|---|
onTrade | A trade event has been received. |
Example
chart.onChartReady(() => {
const api = chart.getApi();
api.onSymbolChange((symbol) => {
console.log("Symbol changed:", symbol);
});
api.onPeriodChange((resolution) => {
console.log("Period changed:", resolution);
});
api.onReplayStart(({ replayIndex }) => {
console.log("Replay started at:", replayIndex);
});
});
Notes
- the chart uses
onPeriodChangefor interval changes - some events only fire when the related feature is available or enabled
- this page lists the public events exposed by the unified API surface