New to Kendo UI for AngularStart a free 30-day trial

TextBlock

A visual element that renders text content. Extends VisualBase and provides functionality for creating and managing text graphics with font styling.

NameTypeDefaultDescription

alignable

boolean

Whether the text block can be aligned within its container.

drawingElement

Group | Text

The underlying drawing element for the text.

id

string

The unique identifier of the element.

options

any

Configuration options for the element.

textElements

Text[]

Array of text elements for multi-line text support.

Constructors

TextBlock

(options: any)

Creates a new TextBlock instance.

Parameters

options

any

Configuration options for the text block

Methods

content

Gets or sets the text content of the text block.

Parameters

text

any

The text content to set, or undefined to get current content

drawingContainer

Gets the drawing container for this element.

Returns

any

The drawing element container

fill

Sets the fill color and opacity of the visual element.

Parameters

color

any

The fill color

opacity?

any

The fill opacity (optional)

position

Gets or sets the position of the element.

Parameters

x

any

The x coordinate or Point object, or undefined to get current position

y?

any

The y coordinate when x is a number

Returns

Point

The current position as a Point when called as getter

redraw

Redraws the text block with updated options.

Parameters

options

any

New options to apply to the text block

rotate

Gets or sets the rotation of the element.

Parameters

angle

any

The rotation angle in radians, or undefined to get current rotation

center

any

The center point for rotation

Returns

Rotation

The current rotation when called as getter

stroke

Sets the stroke color, width, and opacity of the visual element.

Parameters

color

any

The stroke color

width

any

The stroke width

opacity

any

The stroke opacity

visible

Gets or sets the visibility of the element.

Parameters

value

any

The visibility value to set, or undefined to get current visibility

Returns

any

The current visibility state when called as getter

In this article
ConstructorsTextBlockMethods
Not finding the help you need?
Contact Support