PieSeriesView.LabelPosition Property
Gets or sets a position for pie sector labels.
Namespace: DevExpress.WinUI.Charts
Assembly: DevExpress.WinUI.Charts.v23.2.dll
NuGet Package: DevExpress.WinUI
#Declaration
[DP(PieLabelPosition.Inside, Handler = "InvalidateLayout")]
public PieLabelPosition LabelPosition { get; set; }
#Property Value
Type | Description |
---|---|
Pie |
A value that identifies a label position. |
Available values:
Name | Description |
---|---|
Inside | Specifies that point labels should be painted directly on the corresponding slice of a Pie chart. |
Outside | Specifies that point labels should be painted outside a Pie chart, near the corresponding slice. |
Two |
Specifies that point labels should be painted outside a Pie chart and organized into two columns to the left and right of the Pie chart. |
#Remarks
For more information about labels, refer to the following section: Pie Chart - Labels.
#Example
The following markup customizes series labels for a Pie series:
<Window ...
xmlns:Charts="using:DevExpress.WinUI.Charts"
xmlns:dx="using:DevExpress.WinUI.Drawing">
<Charts:PieChart x:Name="chart" ToolTipEnabled="True">
<!--...-->
<Charts:PieChart.Series>
<Charts:PieSeries x:Name="series">
<Charts:PieSeries.View>
<Charts:PieSeriesView ShowLabels="True"
LabelPattern="{}{VP:p}"
LabelPosition="TwoColumns"
ShowLabelConnectors="True"
LegendPointPattern="{}{A} (${V}K)">
<Charts:PieSeriesView.LabelTemplate>
<DataTemplate>
<Border BorderThickness="1"
Opacity="1.0"
BorderBrush="{Binding Path=PointColorBrush}">
<Border.Background>
<SolidColorBrush Color="White"/>
</Border.Background>
<TextBlock Text="{Binding Path=Text}"
Padding="5,1"
Foreground="Black"
FontFamily="SegoeUI"
FontStyle="Normal"
FontSize="14"
FontWeight="Light"
FontStretch="Normal"/>
</Border>
</DataTemplate>
</Charts:PieSeriesView.LabelTemplate>
<Charts:PieSeriesView.LabelConnectorStrokeStyle>
<dx:StrokeStyle DashArray="2 2"/>
</Charts:PieSeriesView.LabelConnectorStrokeStyle>
</Charts:PieSeriesView>
</Charts:PieSeries.View>
<Charts:PieSeries.Data>
<!--...-->
</Charts:PieSeries.Data>
</Charts:PieSeries>
</Charts:PieChart.Series>
</Charts:PieChart>
</Grid>
</Window>