menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ChartStackLabelFont - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ChartStackLabelFont

    Provides options to customize the appearance of the stack label, including font size, color, style, weight, and font family.

    Inheritance
    System.Object
    ChartSubComponent
    ChartDefaultFont
    ChartStackLabelFont
    Inherited Members
    ChartDefaultFont.FontStyle
    ChartDefaultFont.Opacity
    ChartDefaultFont.TextOverflow
    Namespace: Syncfusion.Blazor.Charts
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ChartStackLabelFont : ChartDefaultFont, ISubcomponentTracker, IChartDefaultFont

    Constructors

    ChartStackLabelFont()

    Declaration
    public ChartStackLabelFont()

    Properties

    Color

    Gets or sets the color of the stack label.

    Declaration
    public override string Color { get; set; }
    Property Value
    Type Description
    System.String

    A System.String that represents the font color of the stack label. Accepts values in hexadecimal or rgba format, as valid CSS color strings.

    Overrides
    ChartDefaultFont.Color
    Remarks

    This property defines the font color used for the stack labels in the chart.

    Examples
    <SfChart>
        <ChartSeries XName="x" YName="y" Type="ChartSeriesType.StackingColumn">
        </ChartSeries>
        <ChartStackLabelSettings Visible="true">
            <ChartStackLabelFont Color="green">
            </ChartStackLabelFont>
        </ChartStackLabelSettings>
    </SfChart>

    FontFamily

    Gets or sets the font family of the stack label.

    Declaration
    public override string FontFamily { get; set; }
    Property Value
    Type Description
    System.String

    A System.String that represents the font family used for the stack label.

    Overrides
    ChartDefaultFont.FontFamily
    Remarks

    Specifies the font family applied to the stack label. You can use standard or custom fonts supported by the browser or system.

    Examples
    <SfChart>
        <ChartSeries XName="x" YName="y" Type="ChartSeriesType.StackingColumn">
        </ChartSeries>
        <ChartStackLabelSettings Visible="true">
            <ChartStackLabelFont FontFamily="Arial">
            </ChartStackLabelFont>
        </ChartStackLabelSettings>
    </SfChart>

    FontWeight

    Gets or sets the font weight of the stack label.

    Declaration
    public override string FontWeight { get; set; }
    Property Value
    Type Description
    System.String

    A System.String that represents the weight of the font used for the stack label.

    Overrides
    ChartDefaultFont.FontWeight
    Remarks

    Use this property to define the thickness of the text characters in the stack label, allowing you to control the level of boldness.

    Examples
    <SfChart>
        <ChartSeries XName="x" YName="y" Type="ChartSeriesType.StackingColumn">
        </ChartSeries>
        <ChartStackLabelSettings Visible="true">
            <ChartStackLabelFont FontWeight="600">
            </ChartStackLabelFont>
        </ChartStackLabelSettings>
    </SfChart>

    Size

    Gets or sets the font size of the stack label.

    Declaration
    public override string Size { get; set; }
    Property Value
    Type Description
    System.String

    A System.String that represents the font size of the stack label.

    Overrides
    ChartDefaultFont.Size
    Remarks

    Use this property to specify the font size of the stack label.

    Examples
    <SfChart>
        <ChartSeries XName="x" YName="y" Type="ChartSeriesType.StackingColumn">
        </ChartSeries>
        <ChartStackLabelSettings Visible="true">
            <ChartStackLabelFont Size="12px">
            </ChartStackLabelFont>
        </ChartStackLabelSettings>
    </SfChart>

    TextAlignment

    Gets or sets the alignment of the stack label relative to its position on the chart. The available options are:

    • Near: Aligns the label to the start of the stack.
    • Center: Aligns the label to the center of the stack.
    • Far: Aligns the label to the end of the stack.
    Declaration
    public override Alignment TextAlignment { get; set; }
    Property Value
    Type Description
    Alignment

    An enum value representing the alignment of the stack label. The default value is Center.

    Overrides
    ChartDefaultFont.TextAlignment
    Remarks

    This property sets the alignment for the stack label relative to its position on the chart.

    Examples
    <SfChart>
        <ChartSeries XName=”x” YName=”y” Type=”ChartSeriesType.StackingColumn”>
        </ChartSeries>
        <ChartStackLabelSettings Visible="true">
            <ChartStackLabelFont TextAlignment=”Alignment.Near”>
            </ChartStackLabelFont>
        </ChartStackLabelSettings >
    </SfChart>
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved