ClassDiagramShapeContentDescriptor
Configures the text label or content displayed inside a diagram shape. Use this to add titles, descriptions, values, or custom content that appears within the shape boundaries. Supports text formatting, alignment, and styling to create informative and visually appealing shape labels.
Definition
Namespace:Telerik.Blazor.Components
Assembly:Telerik.Blazor.dll
Syntax:
public class DiagramShapeContentDescriptor : DataVizChildComponentDescriptor
Inheritance: objectDataVizChildComponentDescriptorDiagramShapeContentDescriptor
Constructors
DiagramShapeContentDescriptor()
Declaration
public DiagramShapeContentDescriptor()
Properties
Color
Sets the text color for the shape label content. Accepts CSS color values including hex codes (#333333), named colors (white, black), or RGB/RGBA values. Ensure sufficient contrast against the shape's DiagramShapeFillDescriptor background color for readability. Example: Set to "#FFFFFF" for white text on dark shapes, or "#000000" for black text on light shapes.
FontFamily
Specifies the font family for the shape label text. Accepts any valid CSS font-family value including web-safe fonts and custom font stacks. Falls back to default browser font if specified font is unavailable. Example: Set to "Segoe UI, Tahoma, Geneva, sans-serif" for modern Windows appearance, or "Arial, Helvetica, sans-serif" for universal compatibility.
FontSize
Sets the font size for the shape label text in pixels. Larger values make text more prominent but require larger shapes to accommodate the content. Must fit within the shape's Width and Height dimensions. Example: Set to 14.0 for standard visibility, or 16.0 for larger emphasis text in key diagram nodes.
FontStyle
Controls the font style (normal or italic) for the shape label text. Accepts CSS font-style values: "normal", "italic", or "oblique". Use italic to emphasize or differentiate certain shape types or states. Example: Set to "italic" for optional process steps or alternate workflow paths.
FontWeight
Sets the font weight (thickness) for the shape label text. Accepts CSS font-weight values: "normal", "bold", numeric values (100-900), or keywords (lighter, bolder). Heavier weights make text more prominent and improve visibility on complex diagrams. Example: Set to "bold" or "700" for important nodes like "Start", "End", or decision points.
RelativePadding
Sets the internal padding space around the text content relative to the shape size. Value between 0.0 and 1.0 representing a percentage of the shape dimensions. Larger values create more white space around text, preventing text from touching shape edges. Example: Set to 0.1 for 10% padding, ensuring text doesn't crowd the shape boundaries.
Template
Specifies a custom template function name for rendering shape content with dynamic or complex formatting. The template function receives shape data and can return formatted HTML or text. Advanced feature for creating data-driven labels with conditional display, icons, or multi-line layouts. Refer to Telerik documentation for template function implementation details.
Text
Sets the text content displayed inside the shape. This is the primary label that identifies or describes the shape's purpose in the diagram. Keep text concise to fit within shape boundaries; use TextWrap for longer content. Example: Set to "Process Data", "Decision Point", "Database", or "User Input" to label diagram nodes.
TextWrap
Controls how text wrapping and overflow are handled when content exceeds shape dimensions. Determines whether long text automatically wraps to multiple lines or truncates with ellipsis. Use appropriate wrapping based on shape size and text length to maintain readability. Refer to DiagramShapesContentTextWrap enum for available wrapping options. Example: Enable wrapping for shapes with longer descriptive text that needs to fit within fixed dimensions.
Declaration
public DiagramShapesContentTextWrap? TextWrap { get; set; }
Property Value
Methods
Serialize()
Declaration
public Dictionary<string, object> Serialize()
Returns