Skip to main content

Events

The chart exposes a wide set of runtime events on the unified API.

Chart Lifecycle

EventWhat it tells you
onChartReadyThe chart has finished initializing and is ready to use.
onDataLoadedHistorical chart data has been loaded.
onDataUpdateLive data has updated the chart.
onSymbolChangeThe active symbol has changed.
onPeriodChangeThe active timeframe or resolution has changed.
onChartTypeChangeThe chart style has changed.
onVisibleRangeChangeThe visible time range has changed.
onFullscreenChangeFullscreen mode has been turned on or off.
onHistoryChangeThe chart history or saved state has changed.

Features and Layout

EventWhat it tells you
onFeatureChangeThe enabled or disabled feature set has changed.
onFeatureEnabledA feature has been enabled.
onFeatureDisabledA feature has been disabled.
onThemeChangeThe active theme has changed.
onLayoutChangeThe active layout has changed.
onActivePanelChangeThe active panel has changed.
onSyncChangeSync settings have changed.
onTemplateChangeThe applied template has changed.
onStatusLineChangedStatus line settings have changed.
onGridStyleChangeGrid styling has changed.
onPriceScaleLabelsChangePrice scale label settings have changed.
onTimeScaleFormatChangeTime scale formatting has changed.
onCrosshairStyleChangeCrosshair styling has changed.
onCanvasBackgroundChangeThe canvas background has changed.
onEventsSettingsChangeGeneral events-related settings have changed.

Market and Session

EventWhat it tells you
onTimezoneChangeThe chart timezone has changed.
onSessionChangeThe trading session string has changed.
onSessionToggleSession filtering has been turned on or off.

Indicators and Alerts

EventWhat it tells you
onIndicatorAddedA new indicator has been added.
onIndicatorRemovedAn indicator has been removed.
onAlertsChangeAlerts have been added, updated, or removed.
onAlertTriggeredAn alert has been triggered.
onNotificationAddedA notification has been added.
onNotificationRemovedA notification has been removed.
onAllNotificationsRemovedAll notifications have been cleared.

Drawings and Tools

EventWhat it tells you
onShapeCreatedA drawing shape has been created.
onShapeRemovedA drawing shape has been removed.
onShapeUpdatedA drawing shape has been updated.
onShapeSelectedA drawing shape has been selected.
onDrawingModeEnterDrawing mode has started.
onDrawingModeExitDrawing mode has ended.
onDrawingToolChangeThe active drawing tool has changed.
onDrawingToolActivatedA drawing tool has been activated.
onDrawingToolDeactivatedThe active drawing tool has been deactivated.
onDrawingsClearedAll drawings have been cleared.
onDrawingStyleChangeA drawing style has changed.
onDrawingSnapConfigChangeSnap settings for drawings have changed.
onDrawingSelectedA drawing has been selected.
onDrawingUnselectedA drawing has been unselected.
onDrawingHoveredA drawing has been hovered.
onDrawingAddedA drawing has been added.
onDrawingRemovedA drawing has been removed.
onDrawingsLockChangeDrawing lock state has changed.
onInteractionModeChangedThe current interaction mode has changed.
onToolModeEnterA tool mode such as drawing or measure has started.
onToolModeExitThe active tool mode has ended.
onMeasurementActivatedMeasurement mode has been activated.
onMeasurementDeactivatedMeasurement mode has been deactivated.
onMeasurementStartedA measurement interaction has started.
onMeasurementUpdatedA measurement interaction has updated.
onMeasurementCompletedA measurement interaction has completed.
onMeasurementCancelledA measurement interaction has been cancelled.

Replay

EventWhat it tells you
onSelectStartIndexModeChangeReplay start-index selection mode has changed.
onReplayPanelShowThe replay panel has been shown.
onReplayPanelHideThe replay panel has been hidden.
onReplayStartReplay has started.
onReplayStopReplay has stopped.
onReplayStepForwardReplay moved forward by one step.
onReplayStepBackwardReplay moved backward by one step.
onReplayPlayReplay playback has started.
onReplayPauseReplay playback has paused.
onReplaySpeedChangeReplay speed has changed.
onReplayUpdateCurrentIndexThe replay position has changed.

View and Cursor

EventWhat it tells you
onCrosshairVisibilityChangeCrosshair visibility has changed.
onCrosshairModeChangeCrosshair mode has changed.
onTooltipVisibilityChangeTooltip visibility has changed.
onCursorModeChangeCursor mode has changed.
onPriceScaleViewChangePrice scale position has changed.

Trading and Data

EventWhat it tells you
onTradeA 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 onPeriodChange for 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