alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class ChartLegendTextStyle

    Represents the text style properties for legend text in a chart.

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    ChartSubComponent
    ChartDefaultFont
    ChartLegendTextStyle
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    Inherited Members
    ChartDefaultFont.Color
    ChartDefaultFont.FontStyle
    ChartDefaultFont.Opacity
    ChartDefaultFont.TextAlignment
    ChartDefaultFont.TextOverflow
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.BuildRenderTree(RenderTreeBuilder)
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.OnAfterRender(bool)
    ComponentBase.OnAfterRenderAsync(bool)
    ComponentBase.OnInitialized()
    ComponentBase.OnInitializedAsync()
    ComponentBase.OnParametersSet()
    ComponentBase.OnParametersSetAsync()
    ComponentBase.RendererInfo
    ComponentBase.SetParametersAsync(ParameterView)
    ComponentBase.ShouldRender()
    ComponentBase.StateHasChanged()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    OwningComponentBase.Dispose(bool)
    OwningComponentBase.IsDisposed
    OwningComponentBase.ScopedServices
    Namespace: Syncfusion.Blazor.Charts
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ChartLegendTextStyle : ChartDefaultFont, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

    Constructors

    ChartLegendTextStyle()

    Declaration
    public ChartLegendTextStyle()

    Properties

    FontFamily

    Gets or sets the font family for the legend text.

    Declaration
    [Parameter]
    public override string FontFamily { get; set; }
    Property Value
    Type Description
    string

    A string representing the font family for the legend text. The default font family is determined by the chart's theme. By default, the theme is set to Material with the font family Roboto.

    Overrides
    ChartDefaultFont.FontFamily
    Remarks

    This property enables setting a specific font style for the legend text, allowing for better visual harmony with other theme elements.

    Examples
    // This example demonstrates how to customize the legend text font family in a chart.
    <SfChart>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@MedalDetails" Name="Gold" XName="Country" YName="Gold" />
        </ChartSeriesCollection>
        <ChartLegendSettings Visible="true">
            <ChartLegendTextStyle FontFamily="Roboto"  />
        </ChartLegendSettings>
    </SfChart>

    FontWeight

    Gets or sets the font weight for the legend text.

    Declaration
    [Parameter]
    public override string FontWeight { get; set; }
    Property Value
    Type Description
    string

    A string representing the font weight for the legend text. The default font weight is determined by the chart's theme. By default, the theme is set to Material with a font weight of 400.

    Overrides
    ChartDefaultFont.FontWeight
    Remarks

    Use this property to control the boldness or thinness of the legend text, which can affect readability and emphasis.

    Examples
    // This example demonstrates how to customize the legend text font weight in a chart.
    <SfChart>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@MedalDetails" Name="Gold" XName="Country" YName="Gold" />
        </ChartSeriesCollection>
        <ChartLegendSettings Visible="true">
            <ChartLegendTextStyle FontWeight="400"  />
        </ChartLegendSettings>
    </SfChart>

    Size

    Gets or sets the font size for the legend text.

    Declaration
    [Parameter]
    public override string Size { get; set; }
    Property Value
    Type Description
    string

    A string representing the font size for the legend text. The default font size for the legend text is 14px.

    Overrides
    ChartDefaultFont.Size
    Remarks

    This property allows customization of how large or small the legend's text should appear.

    Examples
    // This example demonstrates how to customize the legend text size in a chart.
    <SfChart>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@MedalDetails" Name="Gold" XName="Country" YName="Gold" />
        </ChartSeriesCollection>
        <ChartLegendSettings Visible="true">
            <ChartLegendTextStyle Size="14px" />
        </ChartLegendSettings>
    </SfChart>

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved