Class CircularDataLabelSettings
The CircularDataLabelSettings class is used to customize the appearance of circular series data labels.
Inherited Members
Namespace: Syncfusion.Maui.Charts
Assembly: Syncfusion.Maui.Charts.dll
Syntax
public class CircularDataLabelSettings : ChartDataLabelSettings
Remarks
To customize data labels, create an instance of the CircularDataLabelSettings class, and set it to the DataLabelSettings property of the circular series.
ShowDataLabels
Data labels can be added to a chart series by enabling the ShowDataLabels option.
<chart:SfCircularChart>
<chart:PieSeries ItemsSource ="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
ShowDataLabels="True"/>
</chart:SfCircularChart>
Customization
To change the appearance of data labels, it offers LabelStyle options.
<chart:SfCircularChart>
<chart:PieSeries ItemsSource ="{Binding Data}" XBindingPath="XValue" YBindingPath="YValue"
ShowDataLabels="True">
<chart:PieSeries.DataLabelSettings>
<chart:CircularDataLabelSettings>
<chart:CircularDataLabelSettings.LabelStyle>
<chart:ChartDataLabelStyle Background = "Red" FontSize="14" TextColor="Black" />
</chart:CircularDataLabelSettings.LabelStyle>
</chart:CircularDataLabelSettings>
</chart:PieSeries.DataLabelSettings>
</chart:PieSeries>
</chart:SfCircularChart>
Constructors
CircularDataLabelSettings()
Initializes a new instance of the CircularDataLabelSettings.
Declaration
public CircularDataLabelSettings()
Fields
ConnectorLineSettingsProperty
Identifies the ConnectorLineSettings bindable property.
Declaration
public static readonly BindableProperty ConnectorLineSettingsProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
LabelPositionProperty
Identifies the LabelPosition bindable property.
Declaration
public static readonly BindableProperty LabelPositionProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
SmartLabelAlignmentProperty
Identifies the SmartLabelAlignment bindable property.
Declaration
public static readonly BindableProperty SmartLabelAlignmentProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Properties
ConnectorLineSettings
Gets or sets the value for customizing the connector line.
Declaration
public ConnectorLineStyle ConnectorLineSettings { get; set; }
Property Value
Type | Description |
---|---|
ConnectorLineStyle | It accepts ConnectorLineStyle and its default value is null. |
Examples
<chart:SfCircularChart>
<chart:PieSeries ItemsSource ="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
ShowDataLabels="True">
<chart:PieSeries.DataLabelSettings>
<chart:CircularDataLabelSettings LabelPosition="Outside" >
<chart:CircularDataLabelSettings.ConnectorLineSettings>
<chart:ConnectorLineStyle Stroke="Red" StrokeWidth="2" />
</chart:CircularDataLabelSettings.ConnectorLineSettings>
</chart:CircularDataLabelSettings>
</chart:PieSeries.DataLabelSettings>
</chart:PieSeries>
</chart:SfCircularChart>
LabelPosition
Gets or sets the options to position the data labels either inside or outside the chart segment.
Declaration
public ChartDataLabelPosition LabelPosition { get; set; }
Property Value
Type | Description |
---|---|
ChartDataLabelPosition | It accepts ChartDataLabelPosition values and its default value is Inside. |
Examples
<chart:SfCircularChart>
<chart:PieSeries ItemsSource="{Binding Data}"
XBindingPath="Product"
YBindingPath="SalesRate"
ShowDataLabels="True">
<chart:PieSeries.DataLabelSettings>
<chart:CircularDataLabelSettings LabelPosition="Outside"/>
</chart:PieSeries.DataLabelSettings>
</chart:PieSeries>
</chart:SfCircularChart>
SmartLabelAlignment
Gets or sets a value to arrange the data labels smartly when they overlap.
Declaration
public SmartLabelAlignment SmartLabelAlignment { get; set; }
Property Value
Type | Description |
---|---|
SmartLabelAlignment | It accepts SmartLabelAlignment values and its default value is Shift. |
Examples
<chart:SfCircularChart>
<chart:PieSeries ItemsSource="{Binding Data}"
XBindingPath="Product"
YBindingPath="SalesRate"
ShowDataLabels="True">
<chart:PieSeries.DataLabelSettings>
<chart:CircularDataLabelSettings LabelPosition="Outside" SmartLabelAlignment="Shift"/>
</chart:PieSeries.DataLabelSettings>
</chart:PieSeries>
</chart:SfCircularChart>