Class
ChartTitle

Configures the main title display for chart components with comprehensive styling options. Provides the primary heading that describes the chart's purpose, data, or context. Essential for creating professional, accessible charts that clearly communicate data meaning. Supports advanced formatting, positioning, and visual customization for optimal presentation. Children: ChartTitleBorder, ChartTitleMargin, ChartTitlePadding.

Definition

Constructors

ChartTitle()

Declaration

cs-api-definition
public ChartTitle()

Properties

Align

Specifies the horizontal alignment of the chart title text within its container. Controls how the title text is positioned relative to the chart width, affecting the overall visual balance. Use this to align the title with other chart elements or match your application's layout patterns. Accepts values from the ChartTitleAlign enumeration for consistent alignment options.

Declaration

cs-api-definition
[Parameter]
public ChartTitleAlign? Align { get; set; }

Property Value

ChartTitleAlign?

Background

Sets the background color of the chart title area. Accepts any valid CSS color value including hex codes (#FF0000), RGB values (rgb(255,0,0)), color names (red), or RGBA for transparency. Use this to create visual emphasis, brand consistency, or improve title readability against complex chart backgrounds. Example: Set to "#f5f5f5" for a subtle gray background or "rgba(0,123,255,0.1)" for a semi-transparent blue tint.

Declaration

cs-api-definition
[Parameter]
public string Background { get; set; }

Property Value

string

ChildContent

Declaration

cs-api-definition
[Parameter]
public RenderFragment ChildContent { get; set; }

Property Value

RenderFragment

Color

Sets the text color of the chart title. Accepts any valid CSS color value including hex codes (#333333), RGB values (rgb(51,51,51)), or color names (black). Use this to ensure title text has appropriate contrast and visibility, matching your application's design theme. Example: Set to "#2c3e50" for a professional dark gray, or "#ffffff" when using dark background colors.

Declaration

cs-api-definition
[Parameter]
public string Color { get; set; }

Property Value

string

Description

Provides an accessible description of the chart for screen readers and assistive technologies. This text is announced when screen readers focus on the chart, helping visually impaired users understand the chart's purpose and content. Use this to describe what the chart shows, its main insights, or important data trends for better accessibility compliance. Example: Set to "Monthly sales data showing 15% growth over the last quarter" for a sales trend chart.

Declaration

cs-api-definition
[Parameter]
public string Description { get; set; }

Property Value

string

Font

Sets the font properties for the chart title text using CSS font syntax. Accepts standard CSS font shorthand notation including font-weight, font-size, and font-family. Use this to control title typography, ensuring it matches your application's design system and hierarchy. Example: Set to "bold 18px Arial" for a prominent title, or "normal 14px 'Segoe UI'" for a subtle header.

Declaration

cs-api-definition
[Parameter]
public string Font { get; set; }

Property Value

string

Position

Specifies where the chart title is positioned relative to the chart area. Controls the vertical placement of the title, allowing it to appear above or below the chart content. Use this to optimize chart layout and ensure the title doesn't interfere with data visualization. Accepts values from the ChartTitlePosition enumeration for standard positioning options.

Declaration

cs-api-definition
[Parameter]
public ChartTitlePosition? Position { get; set; }

Property Value

ChartTitlePosition?

Text

Sets the text content displayed as the chart title. This is the main heading that appears at the top of your chart, typically describing what data is being visualized. Use clear, descriptive text that helps users understand the chart's purpose and content at a glance. Example: Set to "Quarterly Revenue Growth" for a financial chart, or "Website Traffic by Source" for analytics data.

Declaration

cs-api-definition
[Parameter]
public string Text { get; set; }

Property Value

string

Visible

Controls whether the chart title is displayed or hidden. When set to true, the title and its configured styling will be visible. When false, the title is completely hidden. Use this to dynamically show or hide titles based on user preferences, screen size, or chart context. Example: Set to false for embedded charts where external headings are used, or true for standalone chart displays.

Declaration

cs-api-definition
[Parameter]
public bool? Visible { get; set; }

Property Value

bool?

Methods

BuildRenderTree(RenderTreeBuilder)

Declaration

cs-api-definition
protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder

RenderTreeBuilder

Overrides ComponentBase.BuildRenderTree(RenderTreeBuilder)

OnAfterRender(bool)

Declaration

cs-api-definition
protected override void OnAfterRender(bool firstRender)

Parameters

firstRender

bool

Overrides ComponentBase.OnAfterRender(bool)

OnInitialized()

Declaration

cs-api-definition
protected override void OnInitialized()

Overrides DataVizChildComponent.OnInitialized()

OnParametersSet()

Declaration

cs-api-definition
protected override void OnParametersSet()

Overrides ComponentBase.OnParametersSet()

Serialize()

Declaration

cs-api-definition
public Dictionary<string, object> Serialize()

Returns

Dictionary<string, object>