Class ChartStackLabelSettings
Configures the options to customize the stack labels in the chart. Stack labels display the total value for stacked series and provide customization options for appearance and positioning.
Inheritance
Inherited Members
Namespace: Syncfusion.Blazor.Charts
Assembly: Syncfusion.Blazor.dll
Syntax
public class ChartStackLabelSettings : ChartSubComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Constructors
ChartStackLabelSettings()
Declaration
public ChartStackLabelSettings()
Properties
Angle
Gets or sets the angle for rotating the stack labels.
Declaration
[Parameter]
public double Angle { get; set; }
Property Value
| Type | Description |
|---|---|
| double | A double value representing the rotation angle, ranging from 0 to 360. The default value is |
Remarks
This property allows rotating the stack labels by adjusting their angle.
Examples
<SfChart>
<ChartSeries XName=â€x†YName=â€y†Type=â€ChartSeriesType.StackingColumnâ€>
</ChartSeries>
<ChartStackLabelSettings Visible="true" Angle=â€90â€>
</ChartStackLabelSettings>
</SfChart>
Fill
Gets or sets the background color of the stack labels.
Declaration
[Parameter]
public string Fill { get; set; }
Property Value
| Type | Description |
|---|---|
| string | Accepts valid CSS color strings, including hex and rgba values. The default value is |
Remarks
This property sets the background color for the stack labels.
Examples
<SfChart>
<ChartSeries XName=â€x†YName=â€y†Type=â€ChartSeriesType.StackingColumnâ€>
</ChartSeries>
<ChartStackLabelSettings Visible="true" Fill=â€whiteâ€>
</ChartStackLabelSettings>
</SfChart>
Format
Gets or sets the format used to display the stack labels.
Declaration
[Parameter]
public string Format { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string that specifies the format used to display the stack labels. |
Remarks
Supports placeholders such as {value}, where {value} represents the total stack value.
You can use standard numeric format strings such as "N0", "N1", "C0", "P0", etc., to customize the display format of the stack labels.
Examples
<SfChart>
<ChartSeries XName="x" YName="y" Type="ChartSeriesType.StackingColumn">
</ChartSeries>
<ChartStackLabelSettings Visible="true" Format="N1">
</ChartStackLabelSettings>
</SfChart>
Rx
Gets or sets the rounded corner radius along the X-axis for the stack label background.
Declaration
[Parameter]
public double Rx { get; set; }
Property Value
| Type | Description |
|---|---|
| double | A double value representing the corner radius along the X-axis. The default value is |
Remarks
This property sets the rounded corner radius along the X-axis for the stack label background. The border must be set for the rounded corners to be visible.
Examples
<SfChart>
<ChartSeries XName=â€x†YName=â€y†Type=â€ChartSeriesType.StackingColumnâ€>
</ChartSeries>
<ChartStackLabelSettings Visible="true" Rx=â€10â€>
</ChartStackLabelSettings>
</SfChart>
Ry
Gets or sets the rounded corner radius along the Y-axis for the stack label background.
Declaration
[Parameter]
public double Ry { get; set; }
Property Value
| Type | Description |
|---|---|
| double | A double value representing the corner radius along the Y-axis. The default value is |
Remarks
This property sets the rounded corner radius along the Y-axis for the stack label background. The border must be set for the rounded corners to be visible.
Examples
<SfChart>
<ChartSeries XName=â€x†YName=â€y†Type=â€ChartSeriesType.StackingColumnâ€>
</ChartSeries>
<ChartStackLabelSettings Visible="true" Ry=â€10â€>
</ChartStackLabelSettings >
</SfChart>
Visible
Gets or sets a value that determines whether the stack labels are visible.
Declaration
[Parameter]
public bool Visible { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
Remarks
This property controls the visibility of the stack labels, allowing them to be toggled on or off.
Examples
<SfChart>
<ChartSeries XName=â€x†YName=â€y†Type=â€ChartSeriesType.StackingColumnâ€>
</ChartSeries>
<ChartStackLabelSettings Visible="true">
</ChartStackLabelSettings>
</SfChart>