Class
ChartLegendTitle

Configures the title displayed above or below legend items in ChartLegend. Use this component to provide descriptive text that explains what the legend represents, such as "Data Series", "Categories", or "Metrics". Legend titles improve chart accessibility and comprehension by clearly labeling the legend content and establishing visual hierarchy within the chart layout. Children: ChartLegendTitleBorder, ChartLegendTitleMargin, ChartLegendTitlePadding.

Definition

Constructors

ChartLegendTitle()

Declaration

cs-api-definition
public ChartLegendTitle()

Properties

Align

Controls the horizontal alignment of the legend title using ChartLegendTitleAlign values. Choose Left to align the title to the left edge of the legend, Right to align it to the right edge, or Center to center it within the legend. This affects the overall legend layout and visual balance.

Declaration

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

Property Value

ChartLegendTitleAlign?

Background

Sets the background color behind the legend title. Accepts any valid CSS color including hex codes (#F8F9FA), RGB values (rgb(248,249,250)), named colors (whitesmoke), or HSL values. Use background colors to improve title readability against complex legend backgrounds or to create visual emphasis for important legend information.

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 legend title. Accepts any valid CSS color including hex codes (#212529), RGB values (rgb(33,37,41)), named colors (darkslategray), or HSL values. Choose colors that provide good contrast with the Background and legend theme for optimal readability and professional appearance.

Declaration

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

Property Value

string

Font

Defines the font styling for the legend title using CSS font notation. Specify properties like size, weight, and family in a single string, for example: "bold 16px Arial", "italic 14px 'Times New Roman'", or "normal 18px sans-serif". Title fonts are typically larger and bolder than legend labels to establish clear visual hierarchy.

Declaration

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

Property Value

string

Position

Controls the positioning of the legend title relative to legend items using ChartLegendTitlePosition values. Determines whether the title appears above (Top) or below (Bottom) the legend items. This affects the legend's visual hierarchy and reading flow for users.

Declaration

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

Property Value

ChartLegendTitlePosition?

Text

Specifies the text content displayed as the legend title. Use descriptive text that explains what the legend represents, such as "Data Series", "Categories", "Metrics", or any contextual information that helps users understand the legend content. Clear, informative titles improve chart accessibility and comprehension.

Declaration

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

Property Value

string

Visible

Controls whether the legend title is displayed. Set to true (default) to show the title with its descriptive text, or false to hide it for cleaner legend appearance. Visible titles improve legend comprehension by providing context about what the legend items represent.

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>