Class ChartLabelStyle
It is a base class for the ChartAxisLabelStyle, ChartAxisTitle, and ChartDataLabelStyle classes.
Inheritance
Namespace: Syncfusion.Maui.Toolkit.Charts
Assembly: Syncfusion.Maui.Toolkit.dll
Syntax
public class ChartLabelStyle : Element, ITextElement, IThemeElement
Remarks
It provides more options to customize the label.
TextColor - To customize the text color, refer to this TextColor property.
Background - To customize the background color, refer to this Background property.
Stroke - To customize the stroke color, refer to this Stroke property.
StrokeWidth - To modify the stroke width, refer to this StrokeWidth property.
Margin - To adjust the outer margin for labels, refer to this Margin property.
LabelFormat - To customize the label format for labels, refer to this LabelFormat property.
CornerRadius - To defines the rounded corners for labels, refer to this CornerRadius property.
CornerRadius - To change the text size for labels, refer to this FontSize property.
FontFamily - To change the font family for labels, refer to this FontFamily property.
FontAttributes - To change the font attributes for labels, refer to this FontAttributes property.
Constructors
ChartLabelStyle()
Initializes a new instance of the ChartLabelStyle.
Declaration
public ChartLabelStyle()
Fields
BackgroundProperty
Identifies the Background bindable property.
Declaration
public static readonly BindableProperty BackgroundProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The identifier for the Background bindable property determines the background brush of the chart label.
CornerRadiusProperty
Identifies the CornerRadius bindable property.
Declaration
public static readonly BindableProperty CornerRadiusProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The identifier for the CornerRadius bindable property determines the corner radius of the chart label.
FontAttributesProperty
Identifies the FontAttributes bindable property.
Declaration
public static readonly BindableProperty FontAttributesProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The identifier for the FontAttributes bindable property determines the font attributes (e.g., bold, italic) used in the chart label.
FontFamilyProperty
Identifies the FontFamily bindable property.
Declaration
public static readonly BindableProperty FontFamilyProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The identifier for the FontFamily bindable property determines the font family used in the chart label.
FontSizeProperty
Identifies the FontSize bindable property.
Declaration
public static readonly BindableProperty FontSizeProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The identifier for the FontSize bindable property determines the size of the font used in the chart label.
LabelFormatProperty
Identifies the LabelFormat bindable property.
Declaration
public static readonly BindableProperty LabelFormatProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The identifier for the LabelFormat bindable property determines the format string used for the chart label.
MarginProperty
Identifies the Margin bindable property.
Declaration
public static readonly BindableProperty MarginProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The identifier for the Margin bindable property determines the margin around the chart label.
StrokeProperty
Identifies the Stroke bindable property.
Declaration
public static readonly BindableProperty StrokeProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The identifier for the Stroke bindable property determines the brush used for the stroke around the chart label.
StrokeWidthProperty
Identifies the StrokeWidth bindable property.
Declaration
public static readonly BindableProperty StrokeWidthProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The identifier for the StrokeWidth bindable property determines the stroke width around the chart label.
TextColorProperty
Identifies the TextColor bindable property.
Declaration
public static readonly BindableProperty TextColorProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The identifier for the TextColor bindable property determines the color of the text in the chart label.
Properties
Background
Gets or sets a value to customize the appearance of the label's background.
Declaration
public Brush Background { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | It accepts Microsoft.Maui.Controls.Brush values. |
CornerRadius
Gets or sets a value to customize the rounded corners for labels.
Declaration
public CornerRadius CornerRadius { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.CornerRadius | It accepts Microsoft.Maui.CornerRadius values and the default value is 0. |
FontAttributes
Gets or sets a value that indicates the font attributes of the label.
Declaration
public FontAttributes FontAttributes { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.FontAttributes | It accepts Microsoft.Maui.Controls.FontAttributes values. |
FontFamily
Gets or sets a value that indicates the font family of the label.
Declaration
public string FontFamily { get; set; }
Property Value
Type | Description |
---|---|
System.String | It accepts System.String values. |
FontSize
Gets or sets a value that indicates the label's size.
Declaration
public double FontSize { get; set; }
Property Value
Type | Description |
---|---|
System.Double | It accepts System.Double values. |
Remarks
The value must be greater than zero and both System.Double.MinValue and System.Double.MaxValue are not valid.
LabelFormat
Gets or sets a value to customize the label's format.
Declaration
public string LabelFormat { get; set; }
Property Value
Type | Description |
---|---|
System.String | It accepts System.String values. |
Margin
Gets or sets a value that indicates the margin of the label.
Declaration
public Thickness Margin { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Thickness | It accepts Microsoft.Maui.Thickness values and the default value is 3.5. |
Stroke
Gets or sets a value to customize the outer stroke appearance of the label.
Declaration
public Brush Stroke { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | It accepts Microsoft.Maui.Controls.Brush values. |
StrokeWidth
Gets or sets a value that indicates the stroke thickness of the label.
Declaration
public double StrokeWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | It accepts System.Double values and the default value is 0. |
Remarks
The value needs to be greater than zero.
TextColor
Gets or sets a value to customize the appearance of the label's text color.
Declaration
public Color TextColor { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Graphics.Color | It accepts Microsoft.Maui.Graphics.Color values. |