SetObjectText

Sets the text content and formatting for a chart object.

Syntax

SetObjectText(
    name: string,
    text: string,
    fontSize: number = 14,
    fontName: string = 'Roboto Flex',
    fontColor: string = '#000000',
    isStatic: boolean = false
): boolean

Parameters

  • name: string - The name of the object

  • text: string - The text content to set

  • fontSize: number - Optional. The font size (default: 14)

  • fontName: string - Optional. The font name (default: 'Roboto Flex')

  • fontColor: string - Optional. The font color (default: '#000000')

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

Return Value

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

Description

The SetObjectText method sets the text content and formatting properties for a specified chart object. This method is primarily used with text-based objects like labels, but can also be used with other objects that support text properties.

Example

Last updated