Class PyramidDataLabelSettings
The PyramidDataLabelSettings class is used to customize the appearance of pyramid chart data labels.
Inherited Members
Namespace: Syncfusion.UI.Xaml.Charts
Assembly: Syncfusion.Chart.WinUI.dll
Syntax
public sealed class PyramidDataLabelSettings : ChartDataLabelSettings
Remarks
To customize data labels, create an instance of PyramidDataLabelSettings class, and set it to the DataLabelSettings property of the pyramid chart.
ShowDataLabels
Data labels can be added to a chart by enabling the ShowDataLabels option.
<chart:SfPyramidChart ItemsSource ="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
ShowDataLabels="True">
</chart:SfPyramidChart>
ContentTemplate
The appearance of the data label can be customized using the ContentTemplate property of PyramidDataLabelSettings.
<chart:SfPyramidChart ItemsSource ="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
ShowDataLabels="True">
<chart:SfPyramidChart.DataLabelSettings>
<chart:PyramidDataLabelSettings>
<chart:PyramidDataLabelSettings.ContentTemplate>
<DataTemplate>
<StackPanel Margin = "10" Orientation="Vertical">
<Ellipse Height = "15" Width="15" Fill="Cyan"
Stroke="#4a4a4a" StrokeThickness="2"/>
<TextBlock HorizontalAlignment = "Center" FontSize="12"
Foreground="Black" FontWeight="SemiBold"
Text="{Binding}"/>
</StackPanel>
</DataTemplate>
</chart:PyramidDataLabelSettings.ContentTemplate>
</chart:PyramidDataLabelSettings>
</chart:SfPyramidChart.DataLabelSettings>
</chart:SfPyramidChart>
Context
To customize the content of data labels, it offers Context property.
<chart:SfPyramidChart ItemsSource ="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
ShowDataLabels="True">
<chart:SfPyramidChart.DataLabelSettings>
<chart:PyramidDataLabelSettings Context="Percentage" />
</chart:SfPyramidChart.DataLabelSettings>
</chart:SfPyramidChart>
Customization
To change the appearance of data labels, it offers BorderBrush, BorderThickness, Margin, Foreground, Background, FontStyle, FontSize, and FontFamily options.
<chart:SfPyramidChart ItemsSource ="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue"
ShowDataLabels="True">
<chart:SfPyramidChart.DataLabelSettings>
<chart:PyramidDataLabelSettings Foreground="White" FontSize="11"
FontFamily="Calibri" BorderBrush="Black" BorderThickness="1" Margin="1"
FontStyle="Italic" Background="#1E88E5" />
</chart:SfPyramidChart.DataLabelSettings>
</chart:SfPyramidChart>
Constructors
PyramidDataLabelSettings()
Initializes a new instance of the PyramidDataLabelSettings class.
Declaration
public PyramidDataLabelSettings()