GetObjectDescription

Returns the description of a chart object.

Syntax

GetObjectDescription(name: string, isStatic: boolean = false): string

Parameters

  • name: string - The name of the object

  • isStatic: boolean - Optional. Whether the object is static (default: false)

Return Value

Returns a string containing the object's description.

Description

The GetObjectDescription method retrieves the description of a specified chart object. The description typically contains information about the object's purpose, settings, or other relevant details.

Example

// Get description of a specific object
const description = this.api.GetObjectDescription("MyTrendLine");
console.log(`Object description: ${description}`);

// Get description of a static object
const staticDescription = this.api.GetObjectDescription("MyStaticLine", true);
console.log(`Static object description: ${staticDescription}`);

// List all objects with their descriptions
const count = this.api.GetObjectCount();
for (let i = 0; i < count; i++) {
  const name = this.api.GetObjectName(i);
  const description = this.api.GetObjectDescription(name);
  console.log(`Object ${name}: ${description}`);
}

Last updated