SetObjectProperty

Sets a property value for a chart object.

Syntax

SetObjectProperty(
  name: string,
  index: number,
  value: any,
  isStatic: boolean = false
  ): boolean

Parameters

  • name: string - The name of the object

  • index: number - The property identifier

  • value: any - The value to set

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

Return Value

Returns boolean - true if the property was set successfully, false otherwise.

Description

The SetObjectProperty method sets a property value for a specified chart object. It can handle both numeric and string properties, and automatically converts time values from FTODate to the internal format.

Common properties that can be set are listed in the ObjProp documentation.

For TextAnnotatedPaintTool objects (H_LINE, V_LINE, RAY, RECTANGLE, TREND_LINE, SIGN, etc.): OBJPROP_TEXT sets the text content, OBJPROP_COLOR sets the font color, and OBJPROP_TEXT_PARAMS, OBJPROP_FONTSIZE, OBJPROP_FONTNAME sync with font styling. Use OBJPROP_VALIGNMENT and OBJPROP_HALIGNMENT for text alignment.

Example

Last updated