Platforms to show: All Mac Windows Linux Cross-Platform

Back to CDTextBoxMBS class.

CDTextBoxMBS.setAlignment(a as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the alignment of the text relative to the container box.

ArgumentDefaultDescription
a(Mandatory)The alignment specification. See Alignment Specification for supported alignment types.

CDTextBoxMBS.setFontAngle(angle as Double, vertical as boolean=false)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the rotation angle and layout direction of the text.

See Font Specification for details on various font attributes.
ArgumentDefaultDescription
angle(Mandatory)The text rotation angle. Rotation is measured in counter-clockwise direction in degrees.
verticalfalseDetermine if the font is layout horizontally (from left to right) or vertically (from top to down). Vertical layout is common for Oriental languages such as Chinese, Japanese and Korean. A true value means vertical layout. A false value means horizontal layout.

See font specification here:
http://www.monkeybreadsoftware.net/faq-chartdirectorfontspecification.shtml

Some examples using this method:

CDTextBoxMBS.setFontColor(colorvalue as color)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Same as the other setFontColor method, but uses color instead of integer data type for passing color values.

See also:

Some examples using this method:

CDTextBoxMBS.setFontColor(colorvalue as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the color of the text.

If this method is not called, TextColor will be used to draw the text.
ArgumentDefaultDescription
color(Mandatory)The font color.

See also:

CDTextBoxMBS.setFontSize(fontHeight as Double, fontWidth as Double = 0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the font height and width in points.

See Font Specification for details on various font attributes.
ArgumentDefaultDescription
fontHeight(Mandatory)The font height in points.
fontWidth0The font width in points. If the font width is zero, it is assumed to be the same as the font height.

See font specification here:
http://www.monkeybreadsoftware.net/faq-chartdirectorfontspecification.shtml

CDTextBoxMBS.setFontStyle(font as string, fontIndex as Integer = 0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the font of the text by specifying the file that contains the font.

See Font Specification for details on various font attributes.
ArgumentDefaultDescription
font(Mandatory)The font name.
fontIndex0The font index in case the font name refers to a font collection. An index of 0 means the first font.

See font specification here:
http://www.monkeybreadsoftware.net/faq-chartdirectorfontspecification.shtml

Some examples using this method:

CDTextBoxMBS.setHeight(height as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the height of the text box.

By default, the height of the text box is automatically determined to be just enough to hold the text. The setHeight method can be used to specified a fix height.
ArgumentDefaultDescription
height(Mandatory)The height of the text box in pixels.

CDTextBoxMBS.setMargin(leftMargin as Integer, rightMargin as Integer, topMargin as Integer, bottomMargin as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the margins of the text box in pixels.

The margins of a text box are the distances between the borders of the text box to the text inside. By default, the left and right margins are approximately half the font width, and the top and bottom margins are approximately 1/4 of the font height.
ArgumentDefaultDescription
leftMargin(Mandatory)The left margin in pixels.
rightMargin(Mandatory)The right margin in pixels.
topMargin(Mandatory)The top margin in pixels.
bottomMargin(Mandatory)The bottom margin in pixels.

See also:

CDTextBoxMBS.setMargin(m as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets all margins (left, right, top, and bottom) of the text box to the same value.

The margins of a text box are the distances between the borders of the text box to the text inside. By default, the left and right margins are approximately half the font width, and the top and bottom margins are approximately 1/4 of the font height.
ArgumentDefaultDescription
m(Mandatory)The left, right, top and bottom margins in pixels.

See also:

CDTextBoxMBS.setMaxWidth(width as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the maximum width of the text box and wraps text if necessary.

By default, the width of the text box is automatically determined to be the length of the text. This method can be used to limit the width of the text box. If the text requires a longer width for display, it will be wrapped into multiple lines.
ArgumentDefaultDescription
maxWidth(Mandatory)The maximum width of the text box in pixels.

CDTextBoxMBS.setText(text as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the text to be shown in the text box.

See ChartDirector Mark Up Language on how to embed special tags in the text for sophisticated formatting.
ArgumentDefaultDescription
text(Mandatory)The text to be displayed in the text box.

CDTextBoxMBS.setTruncate(maxWidth as Integer, maxLines as Integer = 1)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the maximum number of lines in the text box, and truncate the text if it exceeds the line count.

The maxWidth parameter of this method specifies the maximum width of the text box. If the text requires a longer width for display, it will be wrapped into multiple lines. However, if the number of lines exceed maxLines, the text will be truncated, with the last visible characters replaced with "...".

If maxLines is 1 (the default), the text will never be wrapped and will be truncated directly if it needs more than maxWidth for display.
ArgumentDefaultDescription
maxWidth(Mandatory)The maximum width of the text box in pixels.
maxLines1The maximum number of lines that the text box can have. The text will be truncated if it exceeds the maximum number of lines.

CDTextBoxMBS.setWidth(width as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the width of the text box and wraps text if necessary.

By default, the width of the text box is automatically determined to be the length of the text. The setWidth method can be used to specified a fix width. If the text requires a longer width for display, the text will be wrapped into multiple lines.
ArgumentDefaultDescription
width(Mandatory)The width of the text box in pixels.

The items on this page are in the following plugins: MBS ChartDirector Plugin.


The biggest plugin in space...