GetCurrentChartId

Description

The GetCurrentChartId method retrieves the ID of the currently active chart.

Syntax

public GetCurrentChartId(): number

Return Value

Returns a number representing the ID of the current chart. Returns -1 if no chart is currently active.

Example

const currentChartId = this.api.GetCurrentChartId()
if (currentChartId !== -1) {
    console.log(`Current chart ID: ${currentChartId}`)
} else {
    console.log('No active chart')
}

Last updated