Class TextOptions
Defines the complete set of options for rendering an SVG text element in chart components,
including font styling, positioning, multi-line support, accessibility attributes, and inline style.
Inherited Members
Namespace: Syncfusion.Blazor.DataVizCommon
Assembly: Syncfusion.Blazor.dll
Syntax
public class TextOptions
Constructors
TextOptions()
Initializes a new default instance of TextOptions with all properties at their default values.
Declaration
public TextOptions()
TextOptions(string, string, string, FontOptions, string, string, string, string, string, string, string, string, string, string)
Initializes a new instance of TextOptions with all required SVG text attributes.
Declaration
public TextOptions(string x, string y, string fill, FontOptions font, string text, string anchor, string id, string transform = "", string labelRotation = "0", string dominantBaseline = "undefined", string accessibilityText = "", string role = "text", string tabIndex = "", string style = "")
Parameters
| Type | Name | Description |
|---|---|---|
| string | x | The x-coordinate of the text element. |
| string | y | The y-coordinate of the text element. |
| string | fill | The fill color. Falls back to |
| FontOptions | font | The FontOptions providing font family, size, weight, and style. |
| string | text | The text content string. |
| string | anchor | The SVG |
| string | id | The unique element identifier. |
| string | transform | Optional SVG transform attribute value. |
| string | labelRotation | Optional label rotation angle in degrees. Defaults to |
| string | dominantBaseline | Optional SVG dominant-baseline value. Defaults to |
| string | accessibilityText | Optional ARIA label text for screen readers. |
| string | role | Optional ARIA role. Defaults to |
| string | tabIndex | Optional tabindex value for keyboard navigation. |
| string | style | Optional inline CSS style string. |
Properties
AccessibilityText
Gets or sets the ARIA label text for the element, used as the aria-label attribute value for screen-reader accessibility.
Declaration
public string AccessibilityText { get; set; }
Property Value
| Type |
|---|
| string |
ChildContent
Gets or sets the RenderFragment representing child tspan content injected for multi-line text rendering.
Declaration
public RenderFragment ChildContent { get; set; }
Property Value
| Type |
|---|
| RenderFragment |
DominantBaseline
Gets or sets the SVG dominant-baseline attribute value (e.g., "auto", "middle", "hanging").
Declaration
public string DominantBaseline { get; set; }
Property Value
| Type |
|---|
| string |
Fill
Gets or sets the fill color of the text. Accepts a valid CSS color string. Falls back to Color when empty.
Declaration
public string Fill { get; set; }
Property Value
| Type |
|---|
| string |
Font
Gets or sets the source FontOptions object used to derive font properties when individual font fields are not explicitly set.
Declaration
public object Font { get; set; }
Property Value
| Type |
|---|
| object |
FontFamily
Gets or sets the font family of the text element.
Declaration
public string FontFamily { get; set; }
Property Value
| Type |
|---|
| string |
FontSize
Gets or sets the font size of the text (e.g., "12px").
Declaration
public string FontSize { get; set; }
Property Value
| Type |
|---|
| string |
FontStyle
Gets or sets the font style of the text (e.g., "normal", "italic").
Declaration
public string FontStyle { get; set; }
Property Value
| Type |
|---|
| string |
FontWeight
Gets or sets the font weight of the text (e.g., "normal", "bold", "600").
Declaration
public string FontWeight { get; set; }
Property Value
| Type |
|---|
| string |
Id
Gets or sets the unique identifier of the text element.
Declaration
public string Id { get; set; }
Property Value
| Type |
|---|
| string |
LabelRotation
Gets or sets the rotation angle (in degrees) for axis labels. Used for computing rotated label intersection checks.
Declaration
public string LabelRotation { get; set; }
Property Value
| Type |
|---|
| string |
Role
Gets or sets the ARIA role of the text element. Defaults to "text".
Declaration
public string Role { get; set; }
Property Value
| Type |
|---|
| string |
Style
Gets or sets the inline CSS style string applied to the text element via the data-sf-style attribute.
Declaration
public string Style { get; set; }
Property Value
| Type |
|---|
| string |
TabIndex
Gets or sets the tabindex attribute value for keyboard navigation support.
Declaration
public string TabIndex { get; set; }
Property Value
| Type |
|---|
| string |
Text
Gets or sets the text content to render inside the SVG text element.
Declaration
public string Text { get; set; }
Property Value
| Type |
|---|
| string |
TextAnchor
Gets or sets the SVG text-anchor attribute value (e.g., "start", "middle", "end").
Declaration
public string TextAnchor { get; set; }
Property Value
| Type |
|---|
| string |
TextCollection
Gets or sets the collection of text strings for multi-line text rendering via tspan elements.
Declaration
public List<string> TextCollection { get; set; }
Property Value
| Type |
|---|
| List<string> |
TextLocationCollection
Gets or sets the collection of TextLocation entries that pair each text string with its vertical (y) position for multi-line rendering.
Declaration
public List<TextLocation> TextLocationCollection { get; set; }
Property Value
| Type |
|---|
| List<TextLocation> |
Transform
Gets or sets the SVG transform attribute (e.g., "rotate(-45, 100, 200)") applied to the text element.
Declaration
public string Transform { get; set; }
Property Value
| Type |
|---|
| string |
X
Gets or sets the x-coordinate of the text element.
Declaration
public string X { get; set; }
Property Value
| Type |
|---|
| string |
Y
Gets or sets the y-coordinate of the text element.
Declaration
public string Y { get; set; }
Property Value
| Type |
|---|
| string |