Class PolarDataLabelSettings
The PolarDataLabelSettings class is used to customize the appearance of polar series data labels.
Inherited Members
Namespace: Syncfusion.UI.Xaml.Charts
Assembly: Syncfusion.Chart.WinUI.dll
Syntax
public sealed class PolarDataLabelSettings : ChartDataLabelSettings
Remarks
To customize data labels, create an instance of PolarDataLabelSettings class, and set it to the DataLabelSettings property of the polar series.
ShowDataLabels
Data labels can be added to a chart series by enabling the
<chart:SfPolarChart>
<!-- ... Eliminated for simplicity-->
<chart:PolarLineSeries ItemsSource ="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
ShowDataLabels="True"/>
</chart:SfPolarChart>
ContentTemplate
The appearance of the data label can be customized using ContentTemplate property of PolarDataLabelSettings.
<chart:SfPolarChart>
<!-- ... Eliminated for simplicity-->
<chart:PolarLineSeries ItemsSource ="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
ShowDataLabels="True">
<chart:PolarLineSeries.DataLabelSettings>
<chart:PolarDataLabelSettings>
<chart:PolarDataLabelSettings.ContentTemplate>
<DataTemplate>
<Grid>
<Ellipse Width = "30" Height="30" HorizontalAlignment="Left"
VerticalAlignment="Top" Fill="White" Stroke="#0078DE" StrokeThickness="2" />
<TextBlock HorizontalAlignment = "Center" VerticalAlignment="Center"
Foreground="#FF585858" Text="{Binding}" TextWrapping="Wrap" />
</Grid>
</DataTemplate>
</chart:PolarDataLabelSettings.ContentTemplate>
</chart:PolarDataLabelSettings>
</chart:PolarLineSeries.DataLabelSettings>
</chart:PolarLineSeries>
</chart:SfPolarChart>
Context
To customize the content of data labels, it offers Context property.
<chart:SfPolarChart>
<!-- ... Eliminated for simplicity-->
<chart:PolarLineSeries ItemsSource ="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
ShowDataLabels="True">
<chart:PolarLineSeries.DataLabelSettings>
<chart:PolarDataLabelSettings Context="Percentage" />
</chart:PolarLineSeries.DataLabelSettings>
<chart:PolarLineSeries />
</chart:SfPolarChart>
Customization
To change the appearance of data labels, it offers BorderBrush, BorderThickness, Margin, Foreground, Background, FontStyle, FontSize, and FontFamily options.
<chart:SfPolarChart>
<!-- ... Eliminated for simplicity-->
<chart:PolarLineSeries ItemsSource ="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
ShowDataLabels="True">
<chart:PolarLineSeries.DataLabelSettings>
<chart:PolarDataLabelSettings Foreground="White" FontSize="11"
FontFamily="Calibri" BorderBrush="Black" BorderThickness="1" Margin="1"
FontStyle="Italic" Background="#1E88E5" />
</chart:PolarLineSeries.DataLabelSettings>
<chart:PolarLineSeries />
</chart:SfPolarChart>
ConnectorLine
A connector line is used to connect the label and data point using a line. The ShowConnectorLine property of PolarDataLabelSettings is used to enable the connector line in the circular chart. The connector line can be customized using ConnectorHeight, ConnectorLineStyle, and ConnectorType properties.
<chart:SfPolarChart>
<!-- ... Eliminated for simplicity-->
<chart:PolarLineSeries ItemsSource ="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
ShowDataLabels="True">
<chart:PolarLineSeries.DataLabelSettings>
<chart:PolarDataLabelSettings ConnectorHeight = "40" ShowConnectorLine="True">
<chart:PolarDataLabelSettings.ConnectorLineStyle>
<Style TargetType = "Path">
<Setter Property="StrokeDashArray" Value="5,3"/>
</Style>
</chart:PolarDataLabelSettings.ConnectorLineStyle>
</chart:PolarDataLabelSettings>
</chart:PolarLineSeries.DataLabelSettings>
</chart:PolarLineSeries>
</chart:SfPolarChart>
Constructors
PolarDataLabelSettings()
Initializes a new instance of the PolarDataLabelSettings class.
Declaration
public PolarDataLabelSettings()